Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

as.data.frame.function

Make a function return a data frame.


Description

Create a new function that returns the existing function wrapped in a data.frame with a single column, value.

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

This is useful when calling *dply functions with a function that returns a vector, and you want the output in rows, rather than columns. The value column is always created, even for empty inputs.


plyr

Tools for Splitting, Applying and Combining Data

v1.8.6
MIT + file LICENSE
Authors
Hadley Wickham [aut, cre]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.