How to get ProjectTemplate to load your logger data into R automatically.
ProjectTemplate is an R package which helps lay out your R scripts and data in a standardised and well conceived folder structure. The idea is that what each script is for (ie pre-processing, analysis, plotting) will be more obvious both to any colleagues you might like to share your work with, and also more obvious to your future self when you need to revisit the analysis in the future. It seems like a brilliant idea, implemented by experts, and introduced to me by Richard (Xuanlong Ma).
Over the weekend I had a go at putting in some data files from my Queensland field sites. The idea behind ProjectTemplate is that your data files and R libraries are automatically loaded when you load a project's directory, according to the template configuration files which you are free to edit. So first things first, I had to figure out what I need to do to the raw .dat files produced by our Campbell Science loggers so they can be loaded by ProjectTemplate.
Our lab usually seems to download .dat files with "Long Headers (TOA5)". In short, to use these you need to:
1. Rename the files to .csv. According to the Campbell Science manual they already are CSV files (and it is unclear to me why they don't have this extension already - if you know of the reason, please let me know).
2. Delete the extra header rows, so that there is only the single row of column names above your data.
If you do this, ProjectTemplate will automatically load these files if they're placed in the pre-defined /data/ subfolder.