generate_filename: Generate a file name for a report

Description Usage Arguments Value Examples

View source: R/generate_filename.R

Description

Generate a file name for a report

Usage

1
2
3
4
5
6
7
8
9
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
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 Dec. 12, 2020, 10:35 p.m.