as.data.frame.by: Convert the results of by() to a data.frame.

Description Usage Arguments Value Examples

View source: R/Rfunctions.R

Description

Converts the results of by() to a data.frame if possible, (reducing dimensionality and adding repetition as necessary)

Usage

1
2
3
4
5
  ## S3 method for class 'by'
 as.data.frame(x, row.names = NULL,
    optional = FALSE,
    colnames = paste("IDX", seq(length(dim(x))), sep = ""),
    na.rm = TRUE, ...)

Arguments

x

The by object

row.names

Names of the rows. If NULL, function tries guessing them

optional

Ignored.

colnames

Names of columns

na.rm

Remove NAs or not.

...

Pass-alongs.

Value

A data.frame.

Examples

1
2
3
4
5
6
test.by <- by( ChickWeight$weight, ChickWeight$Diet, mean)
	test.by
	class(test.by)
	str(test.by)
	test.df <-as.data.frame(test.by)
	str(test.df)

taRifx documentation built on April 14, 2020, 6:27 p.m.