Skip to contents

Categorise data

Usage

categ(data, var, id = "ID", cat = "Quartiles", save_bound = TRUE)

Arguments

data

dataframe containing an ID-column (first column) and the data to be categorised

var

vector containing the columns that should be categorised

id

string, column name of the ID

cat

string, specifcation of how the data should be categorised, choose from Quartiles/p80/p60/e10/no, default is Quartiles

save_bound,

boolean whether the cut-off points of the categories should be saved, default is TRUE

Value

a list of dataframes containing the categorised variables specified in var and the ID column of the original dataframe and a dataframe of the boundaries per category, if save_bound is TRUE