# create a division with a between-subset variable
d <- divide(iris, by = "Species",
bsvFn = function(x) list(msl = mean(x$Sepal.Length)))
# create a cognostics function that gets max sepal length
cogFn <- function(x)
list(maxsl = max(x$Sepal.Length))
# apply the cognostics function to the first key-value pair
applyCogFn(cogFn, d[[1]])
Run the code above in your browser using DataLab