camr_column_abbreviations | R Documentation |
Function to match labels describing variable categories and data types to abbreviations contained within a column name.
camr_column_abbreviations(
column_name = "",
type = NULL,
custom = NULL,
n = NA,
separator = "."
)
column_name |
A standardized variable name (i.e., 'GGG.TTT.Var_name' or 'GGG.TTT.Optional.Var_name'). |
type |
The type of abbreviation whose label is to be extracted. |
custom |
An optional matrix with two columns, 'Abbr' and 'Label', for custom abbreviations and labels, respectively. |
n |
The number of rows to create when
generating a template for the matrix to
pass to the |
separator |
The punctuation used to separate abbreviations, typically a period. |
A character string. If only n
is
provided, a matrix with n
rows with
columns 'Abbr' and 'Label' to use as a
template for custom abbreviations/labels.
Kevin Potter
# List pre-defined abbreviations and labels
camr_column_abbreviations( type = 'category' )
camr_column_abbreviations( type = 'data type' )
# Match abbreviation for variable categories
camr_column_abbreviations(
'IDS.CHR.Subject', type = 'category'
)
# Match abbreviation for data type
camr_column_abbreviations(
'IDS.CHR.Subject', type = 'data type'
)
# Create template for custom abbreviations
# and labels
M <- camr_column_abbreviations( n = 3 )
M[,1] <- c( 'BL', 'Y1', 'Y2' )
M[,2] <- c( 'Baseline', 'Year 1', 'Year 2' )
camr_column_abbreviations( 'SMK.INT.BL.Quit_status', custom = M )
camr_column_abbreviations( 'SMK.INT.Y2.Quit_status', custom = M )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.