Learn R Programming

Greg (version 2.0.2)

prMapVariable2Name: A function that tries to resolve what variable corresponds to what row

Description

As both the getCrudeAndAdjustedModelData() and the printCrudeAndAdjustedModel() need to now exactly what name from the coef()/summary.rms() correspond to we for generalizeability this rather elaborate function.

Usage

prMapVariable2Name(var_names, available_names, data, force_match = TRUE)

Value

list Returns a list with each element has the corresponding variable name and a subsequent list with the parameters no_rows

and location indiciting the number of rows corresponding to that element and where those rows are located. For factors the list also contains

lvls and no_lvls.

Arguments

var_names

The variable names that are saught after

available_names

The names that are available to search through

data

The data set that is saught after

force_match

Whether all variables need to be identified or not. E.g. you may only want to use some variables and already pruned the available_names and therefore wont have matches. This is the case when getCrudeAndAdjustedModelData() has been used together with the var_select argument.