View source: R/check_filename.R
check_filename | R Documentation |
Check if a file name adheres to guidance based on advice from years of collaborating with stakeholders and scientists while working with a plethora of softwares. Users and softwares change over time and data often is static; thus, it is imperative that file names are easy to work with and consistent.
check_filename(paths)
paths |
A vector of file paths to check. |
A vector of approved file paths and a warning if one or more supplied paths did not pass the checks.
The following guidelines are ordered in terms of importance with the understanding that it will be difficult to adhere to all guidelines at all times. The list is meant to be a rainbows and lollipops ideology; where, it is better to know what everyone wants rather than assume anything.
Underscores as separators
Meta data to include in the name could contain information on
area
species
stakeholder
Dates formatted as yyyymmdd or 20210101 for the first day of January in 2021; consider not including the date if
older files will not be valid and users would not consider going back in time
version control will track changes over time
code would need to change in the future to accommodate a new file name, though this can be overcome with crafty coding
No spaces
Without minimal directory structure, e.g., wcgop_commercial_discard.csv rather than ./WCGOP/Commercial/discard.csv
Camel case only when necessary
Kelli Faye Johnson
check_filename(tempdir())
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.