make_numeric: Convert Dichotomous Factors to Numeric Variable

Description Usage Arguments Value

View source: R/make_numeric.R

Description

The functions in the 'processr' package that a dichotomous variable be turned into a numeric variable. This function takes a dichotomous variable and makes it a vector of 0s and 1s, where the reference value is coded zero. It returns a data frame with this new variable added onto it.

Usage

1
make_numeric(var, ref, newvar, data)

Arguments

var

The name of the dichotomous factor variable to be converted, as a character string.

ref

The value of the factor that you consider the reference category, as a character string; this will be converted to zero.

newvar

The name of the new variable, as a character string.

data

The data frame.

Value

A data frame with the new variable added onto it.


markhwhiteii/processr documentation built on Dec. 7, 2020, 11:25 p.m.