Learn R Programming

dat (version 0.5.0)

DataFrame: 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, ...)

# S3 method for default as.DataFrame(x, ...)

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

# S3 method for 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

Run this code
# NOT RUN {
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"]

# }

Run the code above in your browser using DataLab