trelliscope (version 0.9.7)

applyCogFn: Apply Cognostics Function to a Key-Value Pair

Description

Apply cognostics function to a key-value pair, obtaining additional default cognostics like the conditioning variable values in the case of conditioning variable division, the panel key, and between-subset variables.

Usage

applyCogFn(cogFn, kvSubset, conn = NULL, ...)

Arguments

cogFn
cognostics function
kvSubset
key-value pair
conn
the connection object or ddo/ddf object from which the key/value pair came (see details)
...
additional parameters for special cases (handled internally)

Details

The conn connection object is required in the case of a local disk connection so that the panel key default cognostic can be computed based on the file hash function, if used.

See Also

cog, makeDisplay

Examples

Run this code
# 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