Skip to contents

Make sure that variable names exists for all the variables in the data frame. Creates from scratch or adds missing variable names for variables in data.

Usage

format_variable_names(data, variable_names = NULL, unique = FALSE)

Arguments

data

Data frame or vector.

variable_names

Named vector of variable names corresponding to variables in data. This vector does not have to contain names for all the variables in data. If names for some variables are missing, they will be created. If NULL, variable names are created by subtracting underscore from the column names of data.

Value

Named vector of (optionally unique) variable names for all variables from data.