incRprep: Data preparation for incubation analysis in incR

incRprepR 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 strptime. incRprep assumes that the date and time column contains date and time, If date and time are in different columns, please, concatenate them in one column before running the function.

timezone

time zone for time calculations. See strptime. documentation for more details.

temperature.name

name of the column storing temperature information.

Value

The original data frame with additional columns for:

  1. index: a running number identifying every row in the data set.

  2. time: in '

  3. hour: in 'H' format.

  4. minute: in 'M' format.

  5. second: in 'S' format.

  6. date: in 'Y-m-d' format.

  7. dec_time: time in decimal hours (e.g. "22:30" becomes 22.5).

  8. 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)

PabloCapilla/incR documentation built on July 22, 2023, 12:18 p.m.