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

1
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.

Note

This function is used inside of makeDisplay and is exposed for users who are curious about what the complete output of a cognostics function will look like.

See Also

cog, makeDisplay

Examples

1
2
3
4
5
6
7
8
# 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]])

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.