list_wrap: Returns a function that coerces the return values of a...

list_wrap_xR Documentation

Returns a function that coerces the return values of a function to a list

Description

Returns a function that coerces the return values of a function to a list

Usage

list_wrap_x(f)

list_wrap_df(f)

Arguments

f

(function)
the function to wrap.

Details

list_wrap_x generates a wrapper which takes x as its first argument, while list_wrap_df generates an otherwise identical wrapper function whose first argument is named df.

We provide both because when using the functions as tabulation in analyze(), functions which take df as their first argument are passed the full subset data frame, while those which accept anything else notably including x are passed only the relevant subset of the variable being analyzed.

Value

A function that returns a list of CellValue objects.

Author(s)

Gabriel Becker

Examples

summary(iris$Sepal.Length)

f <- list_wrap_x(summary)
f(x = iris$Sepal.Length)

f2 <- list_wrap_df(summary)
f2(df = iris$Sepal.Length)


Roche/rtables documentation built on April 30, 2024, 11:18 p.m.