Learn R Programming

OpasnetUtils (version 1.3)

ovariable-class: Class "ovariable"

Description

Standard modelling variables for the Opasnet modelling framework

Arguments

Objects from the Class

Objects can be created by calls of the form new("ovariable", ...). Or by using the Ovariable-constructor.

Slots

name:

Object of class "character" name of variable, should match object name

output:

Object of class "data.frame" output from formula and/or data operations

data:

Object of class "data.frame" data describing the variable, should have a "Result" column

marginal:

Object of class "logical" identifies output columns which are considered indices

formula:

Object of class "function" a function that produces a data.frame that describes this variable

dependencies:

Object of class "data.frame" list of variables that are used in formula, format is described in details for Fetch

ddata:

Object of class "character" specifies an Opasnet page identifier (Op_enXXXX) which will be used to download most recent data on this variable in the Opasnet database

meta:

Object of class "list" , contains additional information such as the initialization timestamp and the initializers wiki user name when run in Opasnet

Methods

Math

signature(x = "ovariable"): Math will be applied on Result column of output

merge

signature(x = "data.frame", y = "ovariable"): data.frame will be converted to ovariable (with only output slot defined) and then merged

merge

signature(x = "numeric", y = "ovariable"): numeric is converted to data.frame and then to ovariable and then merged

merge

signature(x = "ovariable", y = "data.frame"): same as above

merge

signature(x = "ovariable", y = "numeric"): same as above

merge

signature(x = "ovariable", y = "ovariable"): output slots will be merged with all = TRUE, a blank ovariable with only output defined is returned

Ops

signature(e1 = "numeric", e2 = "ovariable"): numeric is converted to data.frame and then to ovariable and then operated

Ops

signature(e1 = "ovariable", e2 = "numeric"): same as above

Ops

signature(e1 = "ovariable", e2 = "ovariable"): the ovariables are merged and then the two Result columns are operated unto, the result is saved in another Result column (or the same if they are not named: "Var1Result" vs "Result")

plot

signature(x = "ovariable"): plots a simple comparison between sources (data vs formula)

summary

signature(object = "ovariable"): returns a data.frame. Takes function_names and marginals as extra arguments. The former matches character vector elements into functions which will be tapplied with. The latter matches character vector elements to output data.frame columns which define INDEX. The default is to tapply over iterations using mean, sd, min, quantile(probs=0.025), median, quantile(probs=0.975) and max.

unique

signature(x = "ovariable"): applies unique to the output-slot data.frame and returns a copy of the original ovariable where the output has been replaced with the unique rows.

$

signature(x = "ovariable"): provides direct access to the output-slot data.frame columns

$<-

signature(x = "ovariable"): insert into output-slot data.frame column

[

signature(x = "ovariable", i = "ANY", j = "ANY"): select subset from output-slot data.frame, returning an ovariable

[

signature(x = "ovariable", i = "ANY", j = "character"): select subset from output-slot data.frame, returning an ovariable

[

signature(x = "ovariable", i = "ANY", j = "missing"): select subset from output-slot data.frame, returning an ovariable

See Also

Ovariable