| subset | R Documentation |
Base-faithful table manipulation helpers built around explicit arguments,
returning a basetable. See aggregate, count,
drop, merge, move,
orderrows, pick, renamecols,
split, stack, summaries,
uniquerows, unstack, and within
for the remaining core verbs, each documented on its own page.
subset(data, subset = NULL, select = NULL, drop = FALSE, by = NULL)
transform(data, ..., .keep = TRUE, by = NULL)
reshape(data, ..., direction)
data |
A |
subset |
A base-style expression evaluated against columns. |
select, by |
Character vectors naming columns. For |
drop, .keep |
Control flags. |
... |
Additional expressions or arguments passed through to helpers. |
direction |
Additional operation-specific controls. |
Most functions return a basetable.
subset(mtcars, cyl == 6, select = c("mpg", "hp"))
subset(mtcars, mpg > mean(mpg), by = "cyl")
transform(mtcars, power = hp / wt)
transform(mtcars, dev_mpg = mpg - mean(mpg), by = "cyl")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.