Transformations {party} | R Documentation |
Transformations of Response or Input Variables
ptrafo(data, numeric_trafo = id_trafo, factor_trafo = function(x) model.matrix(~ x - 1), surv_trafo = logrank_trafo, var_trafo = NULL)
data |
an object of class data.frame . |
numeric_trafo |
a function to by applied to numeric
elements of data returning a matrix with nrow(data)
rows and an arbitrary number of columns. |
factor_trafo |
a function to by applied to factor
elements of data returning a matrix with nrow(data)
rows and an arbitrary number of columns (usually a dummy or contrast
matrix). |
surv_trafo |
a function to by applied to
elements of class Surv of data returning a
matrix with nrow(data) rows and an arbitrary number of columns. |
var_trafo |
an optional named list of functions to be applied to the
corresponding variables in data . |
trafo
applies its arguments to the elements of data
according to the classes of the elements. See trafo
for more documentation and examples.
A named matrix with nrow(data)
rows and
arbitrary number of columns.
### rank a variable ptrafo(data.frame(y = 1:20), numeric_trafo = rank)