Make QC plots of cropped data
make_qc_plots_of_cropped_data.Rd
This function is intended to be used on cropped data, such as the csv files created by crop_raw_data().
Arguments
- cropped_loc
File path to the directory containing the cropped data generated by crop_raw_data() to use in making QC plots. These files must be in csv format. The names of the cropped data files must start with
_ . For example, a file with air data from site NolanLower and deployment date Summer 2023 should have a filename starting with NolanLower_air_sum_23, like NolanLower_air_sum_23_cropped.csv. - qc_plots_loc
File path to the directory where QC plots will be stored.
Examples
# this code assumes you already have some cropped data available
# so for the example, let's crop some of the raw data that is
# provided with the dataQCtools package
example_loc = fs::path_package("extdata", package = "dataQCtools")
base_loc = paste0(example_loc, "/data/2022_summer/")
rawdata_loc = paste0(base_loc, "1_raw_csv/")
cropped_loc = base_loc
ldrtimes_fn = "LDRTimes_summer22.xlsx"
# first let's delete any files that are already there, so that if you
# have many files we start fresh and just process a few
unlink(paste0(cropped_loc, "2_cropped_csv/*"))
# now let's crop just three files for us to QC
crop_raw_data(rawdata_loc, ldrtimes_fn, cropped_loc, nfiles = 3)
#> Reading file 1 of 3: CedarLower_water_sum_22.csv
#> Reading file 2 of 3: CedarUpper_water_sum_22.csv
#> Reading file 3 of 3: ChalaatLower_water_sum_22.csv
#> Done.
cropped_loc <- paste0(base_loc, "2_cropped_csv/")
qc_plots_loc <- base_loc #paste0(base_loc, "3_qc_plots/")
# get a list of all the cropped data files
filenames <- list.files(path = cropped_loc, pattern=".csv")
# this is now a list of all filenames; we haven't read in the data yet, but
# make sure this lists all the cropped data files you want to plot:
filenames
#> [1] "CedarLower_water_sum_22_cropped.csv"
#> [2] "CedarUpper_water_sum_22_cropped.csv"
#> [3] "ChalaatLower_water_sum_22_cropped.csv"
# then make QC plots
make_qc_plots_of_cropped_data(cropped_loc, qc_plots_loc)
#> Reading in cropped data files...
#> Reading file 1 of 3: CedarLower_water_sum_22_cropped.csv
#> Reading file 2 of 3: CedarUpper_water_sum_22_cropped.csv
#> Reading file 3 of 3: ChalaatLower_water_sum_22_cropped.csv
#> Done reading in cropped data.
#> Computing temperature differences...
#> Making QC plots for site 1 of 3: CedarLower
#> Making QC plots for site 2 of 3: CedarUpper
#> Making QC plots for site 3 of 3: ChalaatLower
#> Done.