View source: R/variable.update.R
variable.update | R Documentation |
Update one or more variable(s) in a DIGRAM Object.
variable.update(
do = NULL,
variable.to.update = NULL,
variable.name = NULL,
variable.label = NULL,
category.names = NULL,
variable.type = NULL,
minimum = NULL,
maximum = NULL,
cutpoints = NULL,
reverse = NULL
)
do |
A digram.object |
variable.to.update |
The number or name of the variable(s) which should be updated |
variable.name |
New name for the variable (string) |
variable.label |
New label for the variable (one or more uppercase letters) |
variable.type |
Type of variable ("ordinal" or "nominal") |
minimum |
Smallest value of the variable (lower values are coded NA) |
maximum |
Largest value of the variable (lower values are coded NA) |
cutpoints |
Cutpoints used to recode the variable Category 1: minimum <= values <= cutpoint(1) Category 2: cutpoint(1) < values <= cutpoint(2) ... Category N: cutpoint(n) < values <= maximum |
reverse |
Boolean. Reverse values (after cutpoints applied). |
A set of variables can be updated by providing a vector of variable names/numbers to update and ordered lists with their new properties. For variable.type, cutpoints, minimum and maximum you can provide one property to give all variables.
Returns a DIGRAM object with (an) updated variable(s)
Jeppe Bundsgaard jebu@edu.au.dk
Kreiner, S. (2003). Introduction to DIGRAM. Dept. of Biostatistics, University of Copenhagen.
data(DHP)
DHP<-variable.update(do=DHP,variable.to.update="dhp36",cutpoints=c(2,3))
DHP<-variable.update(do=DHP,variable.to.update=c(1,3),variable.label=list("32","36"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.