DataFrame {dat}R Documentation

DataFrame and methods

Description

This is a 'data.table' like implementation of a data.frame. Either dplyr or data.table is used as backend. The only purpose is to have R CMD check friendly syntax.

Usage

DataFrame(...)

as.DataFrame(x, ...)

## Default S3 method:
as.DataFrame(x, ...)

## S3 method for class 'data.frame'
as.DataFrame(x, ...)

## S3 method for class 'DataFrame'
x[i, j, ..., by, sby, drop]

Arguments

...

arbitrary number of args
in [ (TwoSidedFormulas)
in constructor see tibble

x

(DataFrame | data.frame)

i

(logical | numeric | integer | OneSidedFormula | TwoSidedFormula | FormulaList) see the examples.

j

(logical | character | TwoSidedFormula | FormulaList | function) character beginning with '^' are interpreted as regular expression

by, sby

(character) variables to group by. by will be used to do transformations within groups. sby will collapse each group to one row.

drop

(ignored) never drops the class.

Details

OneSidedFormula is always used for subsetting rows.

TwoSidedFormula is used instead of name-value expressions in summarise and mutate.

See Also

mutar, FL

Examples

data("airquality")
dat <- as.DataFrame(airquality)
dat[~ Month > 4, ][meanWind ~ mean(Wind), sby = "Month"]["meanWind"]
dat[FL(.n ~ mean(.n), .n = c("Wind", "Temp")), sby = "Month"]


[Package dat version 0.5.0 Index]