cut.folder: In a folder: change numeric variables into factors

View source: R/cut.folder.R

cut.folderR Documentation

In a folder: change numeric variables into factors

Description

This function applies to a folder. For each elements (data frames) of this folder, it changes its numerical columns into factors, using cut.data.frame.

Usage

## S3 method for class 'folder'
cut(x, breaks, labels = NULL, include.lowest = FALSE, right = TRUE, dig.lab = 3L,
    ordered_result = FALSE, cutcol = NULL, ...)

Arguments

x

an object of class folder.

breaks

list or numeric, defining the intervals into which the variables of each element of the folder is to be cut. See cut.folder.

labels

list of character vectors. If not omitted, it gives the labels for the intervals of each column of the elements of x. See cut.folder.

include.lowest

logical, indicating if a value equal to the lowest (or highest, for right = FALSE) 'breaks' value should be included (see cut.folder).

right

logical, indicating if the intervals should be closed on the right (and open on the left) or vice versa (see cut.folder).

dig.lab

integer or integer vector, which is used when labels are not given. It determines the number of digits used in formatting the break numbers. See cut.folder.

ordered_result

logical: should the results be ordered factors? (see cut.folder)

cutcol

numeric vector: indices of the columns of the elements of x to be converted into factors. These columns must all be numeric. Otherwise, there is a warning. See cut.folder.

...

further arguments passed to or from other methods.

Value

An object of class folder with the same length and names as x. Its elements (data frames) have the same column and row names as the elements of x.

For more details, see cut.data.frame

Author(s)

Rachid Boumaza, Pierre Santagostini, Smail Yousfi, Sabine Demotes-Mainard

Examples

data("roses")

x <- as.folder(roses[, c("Sha", "Den", "Sym", "rose")], groups = "rose")
summary(x)

x3 <- cut(x, breaks = 3)
summary(x3)

x7 <- cut(x, breaks = 7)
summary(x7)

dad documentation built on Aug. 30, 2023, 5:06 p.m.