incRprep: Data preparation for incubation analysis in incR

Description Usage Arguments Value Author(s) Examples

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

1
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. dec_time: time in decimal hours (e.g. "22:30" becomes 22.5).

  3. time: in 'H:M' format.

  4. hour: in 'H' format.

  5. minute: in 'M' format.

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

  7. temp1: difference between the ith temperature value and the i-1 one.

Author(s)

Pablo Capilla-Lasheras

Examples

1
2
3
4
5
6
7
8
# loading example data
data(incubation_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)

incR documentation built on May 2, 2019, 6:12 a.m.