prepare_labels_and_colors | R Documentation |
Prepare Labels And Colors
prepare_labels_and_colors(
data,
var = NULL,
na_replaced = TRUE,
path = "https://raw.githubusercontent.com/CSISdefense/Lookup-Tables/master/style/",
missing_allowed = FALSE
)
data |
the data frame to be joined |
var |
the variables (column names) for which to prepare colors; by default all will be done |
na_replaced |
if TRUE, replace NA values with var before adding colors |
path |
The location of the lookup file |
This function applies standard colors and orders to a column var in a data frame data. Colors and order are drawn from pre-existing lookup tables. When values are missing or wrong, these tables must be manually updated. This function is badly optimized, reading in multiple csvs every time. It is intend for use in data preparation source code and not to be used in a real time web environment.
A new data frame built on the variable var. It will include colors, and order, and proper name labels.
FullData<-standardize_variable_names(Path,
FullData)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.