| gdd_read | R Documentation |
Reads constant-temperature development data in long format (one row per observation, with a temperature column and a duration column; optional grouping columns such as life stage). The input may be:
a single csv file (delimiter auto-detected),
a single xlsx/xls file (via the 'readxl' package),
a folder containing csv/xlsx files (batch mode), e.g. one
file per temperature or per stage; the files are combined and
the source file name is kept in a source_file column.
gdd_read(
path,
encoding = "UTF-8",
header = TRUE,
temp_from_file = FALSE,
pattern = "\\.(csv|xlsx|xls)$"
)
path |
Path to a csv/xlsx file or to a folder (batch mode). |
encoding |
Text encoding of csv files, default |
header |
Logical; whether the file(s) contain a header row. Default TRUE. |
temp_from_file |
Logical (batch mode only); if TRUE, the file
name (extension stripped) is converted to a number and written to
the |
pattern |
Regular expression selecting the files in batch mode; default: csv / xlsx / xls. |
A data.frame (single file), or the combined data.frame with
an extra source_file column (folder input).
check_path_type (path handling),
gdd_check, gdd_calc
# Single csv file shipped with the package (inst/extdata)
f <- system.file("extdata", "gdd_example.csv", package = "insectecol")
df <- gdd_read(f)
head(df)
# Batch mode: one csv per temperature, temperature from the file names
d <- system.file("extdata", "gdd_batch", package = "insectecol")
df2 <- gdd_read(d, temp_from_file = TRUE)
head(df2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.