StandColNames.Rd
StandColNames
renames ERA columns as per user selected values for organizational levels of Practice, Outcome and Product (EU) concepts.
StandColNames(Data, PLevel = NA, OLevel = NA, EULevel = NA)
a data.frame
or data.table
of ERA data (e.g. ERA.Compiled
).
character vector of length one; accepted values: T
theme, P
practice or S
subpractice. This parameter indicates the practice
level for analysis. Set to argument to NA
to leave Data
practice column names unchanged.
character vector of length one; accepted values: P
pillar, SP
subpillar, I
indicator or SI
subindicator. This parameter
indicates the outcome level for analysis. Set to argument to NA
to leave Data
outcome column names unchanged.
character vector of length one; accepted values: T
type, S
subtype or P
product. This parameter indicates the product
level for analysis. Note products are also referred to as experimental units (EU) in ERA. Set to argument to NA
to leave Data
product column names unchanged.
StandColNames
returns a data.table
of the supplied dataset with focal columns renamed to Practice
, Practice.Code
, Practice.Base
,
Practice.Base.Code
, Outcome
, Outcome.Code
, Product
, and Product Code
.
The columns in Data
corresponding to the organizational levels selected are renamed to Practice
, Outcome
and Product
. This standardization of
column naming allows generalization of column naming for use with other functions in the ERA
package that assume these columns are present. This is
particularly useful for the creation of interactive apps where the user can choose to explore the data at different levels within the ERA concept hierarchy.
See the CreateConceptLevels
function how parameter codes are translated to ERA column names.