Learn R Programming

tableeasy (version 1.1.2)

div_custom: 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

Run this code
# NOT RUN {
## 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)
# }

Run the code above in your browser using DataLab