| makedata | R Documentation |
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.
makedata(data, ...)
data |
a data frame, list, tibble or object coercible by
|
... |
character strings specifying the names of grouping variables
(factors) in |
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.
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.
nestedFunBuilder for applying functions to subsets
## Not run:
# 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)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.