PrepLabels: Prepare variable labels

View source: R/prep.R

PrepLabelsR Documentation

Prepare variable labels

Description

This function prepares a dataset containing variable labels for use by the main plotting function vlm. The input must contain variables' names in the first column and labels in the second column. All other columns will be dropped. Special characters will create errors and should be stripped outside of R. All labels will be truncated at 145 characters.

Usage

PrepLabels(labelFl, idx = 1:2)

Arguments

labelFl

Either the path of a dataset (a csv file) containing labels, an R object convertible to data.table (e.g., data frame) or NULL. If NULL, no labels will be used. The label dataset must contain at least 2 columns: varCol (variable names) and labelCol (variable labels).

idx

A vector of length 2, giving column index of variable names (first position) and labels (second position).

Value

A data table formated for use by the vlm function.

License

Copyright 2017 Capital One Services, LLC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

See Also

Functions depend on this function: PrintPlots, vlm.

Examples

data(bankLabels)
bankLabels <- PrepLabels(bankLabels)

capitalone/otvPlots documentation built on March 15, 2024, 8:25 a.m.