manip_dt

0th

Percentile

Data manipulation for data tables.

Data manipulation for data tables.

Usage
# S3 method for data.table
filter(.data, ..., .env = parent.frame())

# S3 method for data.table summarise(.data, ...)

# S3 method for data.table mutate(.data, ..., inplace = FALSE)

# S3 method for data.table arrange(.data, ...)

# S3 method for data.table select(.data, ...)

Arguments
.data
a data table
...
variables interpreted in the context of .data
inplace
if FALSE (the default) the data frame will be copied prior to modification to avoid changes propagating via reference.
.env
The environment in which to evaluate arguments not included in the data. The default should suffice for ordinary usage.
Aliases
  • arrange.data.table
  • filter.data.table
  • manip_dt
  • mutate.data.table
  • select.data.table
  • summarise.data.table
Examples
if (require("data.table") && require("hflights")) {
# If you start with a data table, you end up with a data table
hflights <- as.data.table(hflights)
filter(hflights, Month == 1, DayofMonth == 1, Dest == "DFW")
head(select(hflights, Year:DayOfWeek))
summarise(hflights, delay = mean(ArrDelay, na.rm = TRUE), n = length(ArrDelay))
head(mutate(hflights, gained = ArrDelay - DepDelay))
head(arrange(hflights, Dest, desc(ArrDelay)))

# If you start with a tbl, you end up with a tbl
hflights2 <- as.tbl(hflights)
filter(hflights2, Month == 1, DayofMonth == 1, Dest == "DFW")
head(select(hflights2, Year:DayOfWeek))
summarise(hflights2, delay = mean(ArrDelay, na.rm = TRUE), n = length(ArrDelay))
head(mutate(hflights2, gained = ArrDelay - DepDelay))
head(arrange(hflights2, Dest, desc(ArrDelay)))
}
Documentation reproduced from package dplyr, version 0.1, License: MIT + file LICENSE

Community examples

Looks like there are no examples yet.