Learn R Programming

pixiedust (version 0.9.4)

pixieply: Apply Functions Over `dust_list` Objects

Description

The sprinkle methods work with dust_list objects very naturally, but medleys pose a slightly more difficult problem. Medleys are intended to be predefined collections of sprinkles that reduce the time required to format a table with a particular look and style. It seems counter-productive to expect a user to define each of her or his medleys as a method that can work with both dust and dust_list objects. pixieply is a wrapper to lapply that preserves the dust_list class of the object.

pixiemap provides functionality to apply differing sprinkles over each element of a dust_list. The most common example is probably adding a unique caption to each table.

Usage

pixieply(X, FUN, ...)

pixiemap(X, FUN, ..., MoreArgs = NULL, SIMPLIFY = FALSE, USE.NAMES = TRUE)

Arguments

X

An object of class dust_list.

FUN

A function to apply to each element of X

...

Additional arguments to pass to FUN

MoreArgs

a list of other arguments to FUN

SIMPLIFY

logical or character string; attempt to reduce the result to a vector, matrix or higher dimensional array; see the simplify argument of sapply

USE.NAMES

logical; use names if the first ... argument has names, or if it is a character vector, use that character vector as the names.