incRprep {incR} | R Documentation |
Data preparation for incubation analysis in incR
Description
Preparing incubation time series for further analysis. This function takes a data file containing a temporal series of temperature recordings and adds some the extra variables needed to use further functions embedded in the incR package. It simply accommodates a raw data frame, reformatting date and time columns automatically.
Usage
incRprep(data, date.name, date.format, timezone, temperature.name)
Arguments
data |
raw data from incubation time series. It must contain a column with date and time information for each observation (e.g. "2017-05-01 21:01"). The function is written to handle date and time concatenated in one unique column (see example below). |
date.name |
name of the date and time column |
date.format |
format for date and time column.
It must be a character object as specified in the function |
timezone |
time zone for time calculations. See |
temperature.name |
name of the column storing temperature information. |
Value
The original data frame with additional columns for:
index: a running number identifying every row in the data set.
time: in '
hour: in 'H' format.
minute: in 'M' format.
second: in 'S' format.
date: in 'Y-m-d' format.
dec_time: time in decimal hours (e.g. "22:30" becomes 22.5).
temp1: difference between the ith temperature value and the i-1 one.
Author(s)
Pablo Capilla-Lasheras
Examples
# loading example data
data(incR_rawdata)
new.data <- incRprep (data=incR_rawdata,
date.name= "DATE",
date.format= "%d/%m/%Y %H:%M",
timezone="GMT",
temperature.name="temperature")
head (new.data, 3)