Description Usage Arguments Details See Also Examples
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.
1 2 3 4 5 6 7 8 9 10 11 12 | 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]
|
... |
arbitrary number of args
|
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. |
OneSidedFormula
is always used for subsetting rows.
TwoSidedFormula
is used instead of name-value expressions in
summarise
and mutate
.
mutar, FL
1 2 3 4 | 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"]
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.