addData: Add data to a "term" object

View source: R/rterm.R

addDataR Documentation

Add data to a "term" object

Description

Adds a dataset & instructions to a term object, returns the updated object

Usage

addData(term, data, formula = NULL, interval = NULL, energyVar = NULL,
  dateStartVar = NULL, dateEndVar = NULL, daysVar = NULL, daily = TRUE)

Arguments

term

the term object to add data

data

the dataset to add

formula

an optional specification for energy variable and date variables, for example kwhd ~ dateStart + dateEnd.

interval

an optional specification for interval data. "daily" or "monthly"

energyVar

an optional manual specification of the energy variable of the dataset.

dateStartVar

an optional manual specification of the start date variable.

dateEndVar

an optional manual specification of the end date variable.

daysVar

an optional specification of the days in cycle variable (mainly for billing data). Note that you only need to specify any two of dateStartVar, dateEndVar, and daysVar if you do the manual specification.

daily

whether or not the energy use is total across the interval or daily. Mostly this is daily by the time the analyst gets it, but if dealing with raw consumption specify daily = FALSE

Value

the term object with data added

See Also

newTerm addWeather addMethod

Examples

# Ecotope Mothership data
data(ecotope)
mod <- newTerm("Ecotope Mothership")
mod <- addData(mod, ecotope, kwhd ~ dateStart + dateEnd)
mod <- addData(mod, ecotope, energyVar = "kwhd", dateStartVar = "dateStart", dateEndVar = "dateEnd")

EcotopeResearch/rterm documentation built on Oct. 17, 2022, 4:02 p.m.