apply.shrink: Apply a function to a vector for a combination of categories.

Description Usage Arguments Value Note See Also Examples

View source: R/apply.shrink.R

Description

Apply a function to a vector for a combination of categories.

Usage

1
apply.shrink(X, INDICES, FUN = NULL, names, ...)

Arguments

X

Input data to FUN

INDICES

list of categories to be combined

FUN

Function to be applied

names

Column names for the resulting dataframe

...

Additional arguments to FUN

Value

Dataframe of outcomes applying FUN to X for the combination of categories in INDICES

Note

Needs elaboration, or could be dropped/hidden, use merge instead.

See Also

apply.shrink.dataframe, merge

Examples

1
2
3
4
5
## stupid example, showing naming of results
names(apply.shrink(depthloc$z,
  list(a=round(depthloc$lat), b=round(depthloc$lon)), mean))
names(apply.shrink(depthloc$z, list(round(depthloc$lat),
  round(depthloc$lon)), mean, names = c("a", "b", "z")))

geo documentation built on May 29, 2017, 5:36 p.m.