incRenv: Matching environmental and nest temperatures

incRenvR Documentation

Matching environmental and nest temperatures

Description

This function takes a data frame with recordings of environmental temperature and another with nest temperatures and merges both by time. The user can do this work manually, however, incRenv is thought to automate data preparation (in combination with incRprep) to use incRscan after. Code to update and improve this function provided by Natalie van Dis.

Usage

incRenv(
  data.nest,
  data.env,
  env.temperature.name,
  env.date.name,
  env.date.format,
  env.timezone
)

Arguments

data.nest

data frame containing nest temperature recordings. It must have two compulsory columns 'date' and 'hour' displaying dates and the hour of each observation. These two columns are provided if the user uses incRprep before.

data.env

data frame containing environmental temperatures to be merged with nest temperature records. Please, provide date and time of each observation in one unique column as requested for incRprep.

env.temperature.name

name of the column containing temperature recordings in the data.env data frame.

env.date.name

name of the column containing date and time in the data.env data frame.

env.date.format

format of env.date.name. Similar to incRprep.

env.timezone

time zone of the environmental recordings. Similar to incRprep.

Details

This function is thought to be used after incRprep as it uses some of the additional variables created by incRprep.

Value

The original data.nest with an additional column for hour-averaged environmental temperature. This new variable is thought to serve as env_temp in incRscan.

Author(s)

Pablo Capilla-Lasheras

See Also

incRprep incRscan

Examples

data(incR_envdata)  # environmental data
head (incR_envdata)

data(incR_rawdata)  # loading nest data
head (incR_rawdata)

# the first step in to format the raw data using incRprep
new.data <- incRprep (data=incR_rawdata,
                      date.name= "DATE",
                      date.format= "%d/%m/%Y %H:%M",
                      timezone="GMT",
                      temperature.name="temperature")
                      
# then use incRenv to merge environmental data
new.data2 <- incRenv (data.nest = new.data,
                      data.env = incR_envdata, 
                      env.temperature.name = "env_temperature", 
                      env.date.name = "DATE", 
                      env.date.format = "%d/%m/%Y %H:%M", 
                      env.timezone = "GMT")
                     
head (new.data2, 3)

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