div_custom {tableeasy}R Documentation

Split a Variable by Custom Values

Description

Split a continuous variable by custom values. Converts a continuous variable to a categorical variable.

Usage

div_custom(var, div, data)

Arguments

var

A string. A variable to be summarized given as a string.

div

A numeric vector. The variable can be split into at least two levels by custom values.

data

A data frame in which these variables exist.

Value

A factor variable.

Examples

## Load Mayo Clinic Primary Biliary Cirrhosis Data
library(survival)
library(tableeasy)
data(pbc)
## Check variables
head(pbc)
##
div_custom(var = 'age',div = c(40,60),data = pbc)

[Package tableeasy version 1.1.2 Index]