Learn R Programming

plyr (version 1.5.2)

as.data.frame.function: Make a function return a data frame.

Description

Make a function return a data frame.

Usage

## S3 method for class 'function':
as.data.frame(x, row.names, optional,
    ...)

Arguments

x
function to make return a data frame
row.names
necessary to match the generic, but not used
optional
necessary to match the generic, but not used
...
necessary to match the generic, but not used

Details

Create a new function that returns the existing function wrapped in a data.frame

This is useful when calling *dply functions with a function that returns a vector, and you want the output in rows, rather than columns