generate_filename: Generate a file name for a report

View source: R/generate_filename.R

generate_filenameR Documentation

Generate a file name for a report

Description

Generate a file name for a report

Usage

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"
)

generate_filename(
  report_name = "alldata",
  date = "06-20",
  module = "literacy",
  device_name = "DRY"
)

Aypak/dbhelpers documentation built on Sept. 20, 2022, 3:05 p.m.