View source: R/proctor_datasheet.R
proctor_datasheet | R Documentation |
Generating a skeleton file permits a consistent data structure
to be maintained over time. It also eliminates the need to manually create
a file via Excel or another GUI, which is a nuisance and allows errors via
copy-paste or typos. The user may simply specify a directory and the file
is automatically written to disk with a sensible name(
~/<directory>/<date>_<proctor_raw_data>
). Alternatively, a custom
file name can be specified.
proctor_datasheet( prep_sheet = NULL, date = NULL, tin_tare_set = NULL, tin_numbers = NULL, ambient_temp_c = 20, write = TRUE, directory = NULL, path = "auto" )
prep_sheet |
A data frame. It is recommended to pipe this argument
directly from |
tin_tare_set |
Character string (length 1) which identifies the set of tin tare
measurements to use during subsequent data analyses. If |
tin_numbers |
Numeric. Length must equal total number of experimental units in |
ambient_temp_c |
Ambient temperature during the test in °C. Used
to compute water density during data analysis (see
|
write |
Defaults to |
directory |
Directory in which to save the file. |
path |
If |
A tibble of relevant data. Also writes file to disk when write = TRUE
.
# prepare reference sheet for wetting samples from existing water contents and # estimated w_opt values (these should be estimated visually and confirmed with # water content measurements, but are simply typed here for demonstration) library(tibble) library(dplyr) library(tidyr) w_extant_values <- tibble( sample_name = paste0("mix_0", 1:3), w_extant = c(0.048, 0.057, 0.062)) PL_values <- tibble( sample_name = paste0("mix_0", 1:3), PL= c(0.095, 0.10, 0.14), standard = 0.9*PL, modified= standard - 0.03) prep_sheet <- w_extant_values %>% left_join(PL_values) %>% select(-PL) %>% pivot_longer(cols= c(standard:modified), names_to = 'effort', values_to = 'est_w_opt')%>% select(sample_name, effort, everything()) %>% arrange(desc(effort)) %>% proctor_prep(date = Sys.Date()) # write file to disk proctor_datasheet(prep_sheet, dir= paste0(tempdir(), "/") ) # alternatively, return the data sheet as a tibble proctor_datasheet(prep_sheet, write = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.