Learn R Programming

dendrometry (version 0.0.4)

makedata: Create nested data subsets

Description

A convenient wrapper around nestedFunBuilder that creates nested data subsets without applying any function. This is useful for exploring data structure or preparing data for further analysis.

Usage

makedata(data, ...)

Value

A nested list structure where each level corresponds to a factor level, with the deepest level containing the actual data subsets. If no valid factors are provided, returns the original data frame with a warning.

Arguments

data

a data frame, list, tibble or object coercible by as.data.frame to a data frame containing the variables whose names are given in the factor arguments.

...

character strings specifying the names of grouping variables (factors) in data. The nesting order follows the argument order.

Details

This function is equivalent to calling nestedFunBuilder with .fun = identity. It provides a simpler interface when you only need to create nested data structures without applying functions.

See Also

nestedFunBuilder for applying functions to subsets

Examples

Run this code
if (FALSE) {
# require(BiodiversityR)
# data(ifri, package = "BiodiversityR")
# a1 <- makedata(ifri, "forest", "plotID", "species")
# a2 <- makedata(ifri, "species")
# a3 <- makedata(ifri, "forest", "plotID", "species", "size_class")
# identical(makedata(ifri), ifri)
}

Run the code above in your browser using DataLab