View source: R/format_vpc_input_data.R
standardize_column | R Documentation |
Confirm that a column is in the data, and rename data to prepare that column for later use.
standardize_column(dat, cols, colname, coldesc, what, default)
dat |
An input data.frame or similar object |
cols |
A list with an element for colname giving the name for colname in
|
colname |
The name of the column (character scalar) |
coldesc |
The description of the column (character scalar) |
what |
The description of the data (typically "observed" or "simulated") |
default |
A default value (scalar or vector) to use if the column is not found. |
If colname
is already named colname
in dat
,
dat
unchanged. If not, check if dat
has that column name
already, and if so, name the existing dat[[colname]]
to
dat[[paste0(colname, ".old")]]
and then rename
cols[[colname]]
to colname
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.