View source: R/questionnaire_tools.R
fix_ids | R Documentation |
This function first removes the prefix specified in prefix
(if found)
and then converts all columns in pid_cols to numeric. It then takes the first
non-NA value found, using column order in pid_cols for priority. It returns a
vector of ids, with include_prefix prepended if supplied. This assumes x is a
data.table.
fix_ids(x, pid_cols, prefix = NULL, format_ids = FALSE)
x |
A data.frame or data.table. Can be the whole table returned by
|
pid_cols |
A character vector of column names in order of priority. x does not need to include all columns in pid_cols. |
prefix |
A regular expression that will be removed prior to conversion to numeric. |
format_ids |
is either FALSE or an expression understood by
|
A numeric or character vector of ids.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.