as_classification: Convert a data.frame to a classification object

Description Usage Arguments Details

View source: R/as_classification.R

Description

Convert a data.frame to a classification object

Usage

1
as_classification(x, compute_parent = FALSE, order = 1:4)

Arguments

x

the data.frame to convert. See, details for the format of the data.frame

compute_parent

compute the parent column of the input

order

selection of columns from x.

Details

The data.frame should contain the following columns:

id

the id of the category (cast to character)

label

the label of the category (cast to character)

level

the level of the classification in which the category belongs (should be integer)

parent

the id of the parent category (cast to character). Can be omitted when compute_parent = FALSE. Should contain missing values for categories in level 1 of the classification.


uRos2018/categorical documentation built on May 29, 2019, 9:15 a.m.