log_plot: Save a copy of the plot, a current dollars csv, and an excel...

View source: R/Standardization.R

log_plotR Documentation

Save a copy of the plot, a current dollars csv, and an excel copy

Description

Save a copy of the plot, a current dollars csv, and an excel copy

Usage

log_plot(
  plot,
  df,
  filename,
  xlsx,
  sheet,
  path = "..\\output",
  second_path = NA,
  width = 6.5,
  height = 3.5,
  output_doc_svg = TRUE,
  output_doc_png = FALSE,
  suppress_text = NA,
  startRow = 1,
  startCol = NA,
  format = TRUE,
  x_var = NA,
  y_var = NA,
  var_list = NA,
  csv_then_year = TRUE,
  excel_then_year = TRUE,
  excel_y_var = FALSE,
  excel_share = FALSE,
  excel_formulas = FALSE,
  hist_year = 2020,
  cur_year = 2023,
  include_YTD = TRUE,
  group_unlabeled_facets = FALSE,
  num_format = "0.00,,,\"B\""
)

Arguments

plot

a ggplot object

df

the underlying data

filename

the name for the files, excluding extension

xlsx

the excel file to output to

sheet

the sheet to use in excel, typically shorter than the name

group_unlabeled_facets

Whether to all unlabeled facets (but not colors) into a single line

path="..\output\"

what directory for the output

second_path=NA

for saving to a second location to automatically

width=6.5

Width for the plot in inches

height=3.5

Height for the plot in inches

output_doc_svg=TRUE

GGsave a svg of the graph for a document?

output_doc_png=FALSE

GGsave a png of the graph for a document?

suppress_text=NA

Remove titles and captions. If unspecified, treated as TRUE for SVG and FALSE for PNG.

startRow=1

Start row for excel output

startCol=NA

Start column for excel output

format=TRUE

Format the data rather then listing the df directl

x_var=NA

Override option for x_var

y_var=NA

Override option for y_var

var_list=NA

Override option for what variables to include in addition to x_var and y_var, also sets arrangement order.

csv_then_year=TRUE

Override the graphed y_var to include nominal dollars in csv output

excel_then_year=TRUE

Override the graphed y_var to include nominal dollars in excel output

excel_y_var=FALSE

Include the graphed y_var (or over)

excel_share=FALSE

Include percent shares for the y_var for each of the facets

excel_formulas=FALSE

Create formulas to accompany the table

hist_year=2020

Historical anchor to include in summary stats

cur_year=2023

Most recent complete year to include in summary stats

YTD=TRUE

Include formulas for cur_year+1 if excel_formulas is true.

group_unlabeled_facets=FALSE

Combine all unlabeled facet categories into a single line in the data.

num_format="0.00, \"B\""

How to format data values, default "0.00,,,\"B\""

Value

no value


CSISdefense/csis360 documentation built on April 29, 2024, 5:30 p.m.