prepare_labels_and_colors: Prepare Labels And Colors

View source: R/Plot_Labels.R

prepare_labels_and_colorsR Documentation

Prepare Labels And Colors

Description

Prepare Labels And Colors

Usage

prepare_labels_and_colors(
  data,
  var = NULL,
  na_replaced = TRUE,
  path = "https://raw.githubusercontent.com/CSISdefense/Lookup-Tables/master/style/",
  missing_allowed = FALSE
)

Arguments

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

Details

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.

Value

A new data frame built on the variable var. It will include colors, and order, and proper name labels.

Examples

FullData<-standardize_variable_names(Path,
  FullData)


CSISdefense/csis360 documentation built on May 10, 2024, 1:20 a.m.