Generate a file name for a report

generate_filename(
  reports_dir = "~/.reports/",
  report_name,
  date,
  module,
  extension = ".csv",
  device_name,
  separator = "_"
)

Arguments

reports_dir

Directory to prefix the report name with. Default is ~/.reports/

report_name

Name of the report

date

Date of the report

module

Module of the report

extension

File extension. Default is ".csv"

device_name

Name of the device the report comes from

separator

Separator between the inputs. Default is "_"

Value

A string containing the generated file name in the format: reports_dir sep device_name sep report_name sep module sep date extension

e.g ~/.reports/monthend_KRP_numeracy_06-20.csv

Examples

generate_filename( report_name = "monthend", date = "06-20", module = "numeracy", device_name = "KRP" )
#> [1] "~/.reports/monthend_KRP_numeracy_06-20.csv"
generate_filename( report_name = "alldata", date = "06-20", module = "literacy", device_name = "DRY" )
#> [1] "~/.reports/alldata_DRY_literacy_06-20.csv"