reverse_cols: Reverse a series of columns in a dataframe

Description Usage Arguments Examples

Description

Given a dataframe, a list of variables, and the min and max of those variables (which must be the same) reverses all variables. Returns a dataframe containing the result.

Usage

1
reverse_cols(data, variables, min, max)

Arguments

data

The input dataset

variables

A character vector of variables that require reversing

min

The minimum of all the variables to be reversed (for variables that have different mins, use separate function calls)

max

The maximum of all the variables to be reversed

Examples

1
2
# Reverses the carb column in mtcars
reverse_cols(mtcars, 'carb', min = 1, max = 8)

seanchrismurphy/emacalc documentation built on May 12, 2019, 2:03 p.m.