View source: R/prep_conv_table.R
prep_conv_table | R Documentation |
This function pulls in the spring and fall visit data and the water level data from the NETN RAM database to create a table that is used by the compile_sent_WL() function to calculate water level relative to the wetland surface. Only works for a year at a time and for the growing season only. Because well visits are staggered, the fall BARO reading may not exist for the hour that the field water level measurement was taken. This function accounts for that by taking the last logged BARO measurement and using that for the correction factor. If the field measurement and the logged measurement are more than 2 hours apart, you will receive a warning. This function only works correctly for the most recent growing season of data. Must have a the NETN RAM backend database named "RAM_BE" as a DSN. Function is primarily for internal use.
prep_conv_table(
path = NA,
year = as.numeric(format(Sys.Date(), "%Y")),
visits = c("both", "spring", "fall"),
export = TRUE,
quietly = FALSE
)
path |
Quoted path of the folder where the output will be saved |
year |
Numeric. The year you are preparing the data for. Function will only run 1 year at a time. |
visits |
both, spring, fall
|
export |
|
quietly |
|
Returns a data frame with visit times, site, ground height, and correction factor
## Not run:
# Create conversion table for fall-only data
dir = c('C:/Water_level_data/growing_season_2019')
conv_tbl_19 <- prep_conv_table(path = dir, year = 2019, visits = "fall", export = TRUE)
# Create conversion table that averages spring and fall visit without
# printing messages in the console or saving output to file.
dir = c('C:/Water_level_data/growing_season_2019')
conv_tbl_19 <- prep_conv_table(path = dir, year = 2019, visits = "both",
export = FALSE, quietly = TRUE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.