# NOT RUN {
irisDdf <- ddf(iris)
bsvFn <- function(dat) {
list(
meanSL = bsv(mean(dat$Sepal.Length), desc = "mean sepal length"),
meanPL = bsv(mean(dat$Petal.Length), desc = "mean petal length")
)
}
# divide the data by species
bySpecies <- divide(irisDdf, by = "Species", bsvFn = bsvFn)
# see BSV info attached to the result
bsvInfo(bySpecies)
# get BSVs for a specified subset of the division
getBsvs(bySpecies[[1]])
# }
Run the code above in your browser using DataLab