There are going to be files
LOTS of files
The files will change over time
The files will have relationships to each other
NO
myabstract.docx
Joe’s Filenames Use Spaces and Punctuation.xlsx
figure 1.png
fig 2.png
JW7d^(2sl@deletethisandyourcareerisoverWx2*.txt
YES
2014-06-08_abstract-for-sla.docx
joes-filenames-are-getting-better.xlsx
fig01_scatterplot-talk-length-vs-interest.png
fig02_histogram-talk-attendance.png
1986-01-28_raw-data-from-challenger-o-rings.txt
Deliberate use of "-"
and "_"
allows recovery of metadata from the filenames:
"_"
underscore used to delimit units of metadata I want to access later"-"
hyphen used to delimit words so our eyes don’t bleedThis happens to be R
but also possible in the shell
, Python
, etc.
e.g. I’m saving a number of files of temperature data extracted at different resolutions (res
) and for a number of months (month
). Including these parameters in the filename allows me to use them to target files to read in.
write.csv(df, paste("variable", res, month, sep ="_"))
df <- read.csv(paste("variable", res, month, sep ="_"))
Easy to search for files later
Easy to filter file lists based on names
Easy to extract info from file names, e.g. by splitting
New to regular expressions and globbing? be kind to yourself and avoid + Spaces in file names + Punctuation + Accented characters
Name contains info on content
Connects to concept of a slug from semantic URLs
R
scripts:01_marshal-data.r
02_pre-dea-filtering.r
03_dea-with-limma-voom.r
04_explore-dea-results.r
90_limma-model-term-name-fiasco.r
02_pre-dea-filtering-preDE-filtering.png
03-dea-with-limma-voom-voom-plot.png
04_explore-dea-results-focus-term-adjusted-p-values1.png
04_explore-dea-results-focus-term-adjusted-p-values2.png
...
90_limma-model-term-name-fiasco-first-voom.png
90_limma-model-term-name-fiasco-second-voom.png
Use the ISO 8601 standard for dates: YYYY-MM-DD
If you don’t left pad, you get this:
10_final-figs-for-publication.R
1_data-cleaning.R
2_fit-model.R
which is just sad :(
Put something numeric first
Use the ISO 8601 standard for dates
Left pad other numbers with zeros
Machine readable
Human readable
Play well with default ordering