{width=50%}
strings
is an R package developed to help users compile, format, calculate, and visualize oceanographic data, as collected by the Centre for Marine Applied Research's (CMAR) Coastal Monitoring Program. The package can process temperature, dissolved oxygen, and salinity data measured by HOBO Pro V2, TidBiT, aquaMeasure DOT, aquaMeasure SAL, and/or VR2AR sensors.
The purpose of this vignette is to provide a detailed description of the folder and file structure required to compile data with the strings
package. Section 3.1 describes the folder structure required for CMAR's workflow. Section 3.2 is more general, and describes the folder structure required for all strings
users.
See SOP010 for direction on how to compile and format sensor string data and SOP011 for direction on how to trim sensor string data.
strings
foldersThis section describes how to organize the Coastal Monitoring Program data for CMAR's workflow.
All of the data from CMAR's Coastal Monitoring Program is stored in the Data_Strings folder on the shared drive. There is a folder for each station inside the Data_Strings folder (Fig. 1).
If you are processing data from a new station, create a new folder with the appropriate name (this should be the same as the Location_Description
in the log; see Log folder section below).
Inside each station folder is a folder for each deployment at this station and the Deployment History file (Fig. 2).
Deployment folders are named "Station deployment-date", where the date is in the form yyy-mm-dd (e.g., "Birchy Head 2019-05-02"). There is a single space between each word and between the station name and the date (no underscores or dashes). If you are processing data from a new deployment, create a deployment folder with the appropriate name.
The Deployment History tracks the string coordinates, sensor serial numbers and depths, and notes for all deployments at this station. The file is named "station_Deployment_History" (e.g., "Birchy Head_Deployment_History"; Figure 2). Make sure the deployment you are processing is included in the Deployment History file. If it is not, add it by looking up the information in the log (see Log folder section below) or the NSFDA tracking sheet. For new stations, you can create a Deployment History file from the log manually or by using the combine_deployment_logs()
function (see ?combine_deployment_logs
).
Pay attention to separators (e.g., "_", "-", and "space ") when naming deployment folders and history files.
Within each deployment folder, there is a "Log" folder and a folder for each type of sensor on the string, e.g., "Hobo", "aquaMeasure", and/or "Vemco". Spelling and case of these folder names must be exactly as presented here. The following sub-section describes content of the Log folder, and Section 3.2 describes the content of the remaining folders. Other folders in the deployment folder are ignored by the strings
package.
The Log folder contains the deployment log, which is a record of the deployment, including dates of deployment and retrieval, the sensors deployed, and the sensor depths (Fig. 4). If the deployment log does not exist, please make one using information in the NSDFA tracking sheet (see ?create_deployment_log
).
Information from the deployment log is required as arguments for several strings
functions (e.g., compile_*_data()
and format_for_opendata()
). This information can be manually typed into R, or imported from the log using the read_deployment_log()
function. We recommend using the function to save time and reduce opportunity for human error. To use the function, the deployment log must be a .xlsx, .xls, or .csv file. The deployment log should be the only .xlsx, .xls, or .csv file in the Log folder (otherwise the function will stop with an error).
The deployment log should have a row for each sensor on the string, and must contain the following columns:
Deployment_Waterbody
: waterbody where string was deployedLocation_Description
: the station nameLease#
: if located on an aquaculture site, the lease number (NA
otherwise)Deployment
: the deployment date, in the order "Ymd"Retrieval
: the retrieval date, in the order "Ymd"Logger_Latitude
: the latitude at which the string was deployedLogger_Longitude
: the longitude at which the string was deployedLogger_Model
: the type of sensor; see ?read_deployment_log
for optionsSerial#
: the sensor serial numberSensor_Depth
: depth at which the sensor was deployed (numeric or qualitative value)Column names must be spelled as presented above to ensure that R can find and use the information within each column. All other columns will be ignored.
strings
foldersThe sensor data must be saved into folders with specific names to use the strings
package:
You will get a vague error message if the data are not saved in the correct file. We are working to make more helpful error messages.
This section provides details on the content of the aquaMeasure, Hobo, and Vemco folders.
Note the capital "M" in the folder name.
This folder contains all files downloaded from aquaCurrent for the deployment, in .csv or .xlsx format (Fig. 5). You do not need to modify the raw files, although sometimes the package has a hard time parsing the Text
column, which can be safely deleted for CMAR purposes. The file name does not matter.
This folder contains the extracted Hobo and TidbiT files, in .csv or .xlsx format (CMAR users see note below; Fig. 6). Extracted Hobo and TidbiT files are treated the same by the package. The name of the file must be the serial number of the unit. This will be used to match the sensor to the depth at which it was deployed. The compile_HOBO_data()
and compile_all_data()
functions will stop with an error if the name of the file does not match an entry in the serial.table.HOBO
argument (see help files for more info). The raw Hobo files may also be saved in this folder, but other Excel files (those not extracted from Hobo or TidiT files) will cause an error.
CMAR users: Extract the Hobo data in UTC (set Offset from GMT to 0; Fig. 7) and export as a .csv file. See ?compile_HOBO_data
for more information.
This folder contains the extracted VR2 data, in .csv or .xlsx format (Fig. 8). The file name does not matter. The raw VR2 files may also be saved in this folder, but other Excel files (those not extracted from VR2 files) will cause an error.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.