read_calc_fold: #Read a folder of calculation sheets, and append the data to...

View source: R/calcsheet.R

read_calc_foldR Documentation

#Read a folder of calculation sheets, and append the data to the bottle summary

Description

This function reads the [output] sheet of every excel file in a folder and appends the new values to the bottle summary object [bottle_sum].

Usage

read_calc_fold(calc_folder, bottle_sum, bottle_is_file = TRUE)

Arguments

calc_folder

#the calculation folder to be read. chlorophyll, PO4, NO3, pH. All excel files must be formatted correctly with an 'output' sheet.

bottle_sum

#the bottle summary from the [create_bottle()] function

bottle_is_file

#if TRUE (the default) this will read the [bottle.csv] file and creat the [bottle_sum] object. If FALSE, it will append data to the bottle object.

Details

This function, and the [read_calc_file()] function combine the [output] sheet from any calculation excel file (from path ['calc_file]) and the [bottle_sum] object. If [bottle] is not an object (ex. if it is the first time this is run) it will read the [bottle.csv] file from the [bottle_sum] diriectory and create the [bottle_sum] object. [create_bottle()] will overwrite the [bottle.csv] and delete any calc sheet data added in past uses of this function. RUnning this function again will replace these data. This function will read every excel file in the specified folder [calc_folder] from [datasheet_examples.R] and append the [output] sheet to the bottle summary csv. Common errors arise from spelling typos in the header data of the many calculation excel files, or from unexpected values in the columns (characters vs. numbers etc.). Individual files may be run with the [read_calc_file()] function for troubleshooting.


benharden27/seaprocess documentation built on June 28, 2023, 7:20 p.m.