numeric_var: Numeric Variable

Description Usage Arguments Details Value Examples

View source: R/variables.R

Description

Formal description of numeric variable

Usage

1
2
numeric_var(name, desc = NULL, unit = NULL, support = c(0, 1), add = c(0, 0), 
            bounds = NULL, ...)

Arguments

name

character, the name of the variable

desc

character, a description of what is measured

unit

character, the measurement unit

support

the support of the measurements, see below

add

add these values to the support before generating a grid via mkgrid

bounds

an interval defining the bounds of a real sample space

...

ignored

Details

A numeric variable can be discrete (support is then the set of all possible values, either integer or double; integers of length 2 are interpreted as all integers inbetween) or continuous (support is a double of length 2 giving the support of the data).

If a continuous variable is bounded, bounds defines the corresponding interval.

Value

An object of class numeric\_var inheriting from var with corresponding methods.

Examples

1
2
3
4
5
6
  numeric_var("age", "age of patient", "years", support = 25:75)

  numeric_var("time", "survival time", "days", support = 0:365)

  numeric_var("time", "survival time", "days", support = c(0.0, 365), 
              bounds = c(0, Inf))

variables documentation built on June 17, 2021, 5:08 p.m.