Learn R Programming

dfidx (version 0.1-0)

dplyr: Methods for dplyr verbs

Description

methods of dplyr verbs for dfidx objects. Default functions don't work because most of these functions returns either a tibble or a data.frame but not a dfidx

Usage

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

# S3 method for dfidx filter(.data, ...)

# S3 method for dfidx slice(.data, ...)

# S3 method for dfidx mutate(.data, ...)

# S3 method for dfidx transmute(.data, ...)

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

Value

an object of class "dfidx"

Arguments

.data

a dfidx object,

...

further arguments

Author

Yves Croissant

Details

These methods always return the data frame column that contains the indexes and return a dfidx object.

Examples

Run this code
mn <- dfidx(munnell)
select(mn, - gsp, - water)
mutate(mn, lgsp = log(gsp), lgsp2 = lgsp ^ 2)
transmute(mn, lgsp = log(gsp), lgsp2 = lgsp ^ 2)
arrange(mn, desc(unemp), labor)
filter(mn, unemp > 10)
pull(mn, gsp)
slice(mn, c(1:2, 5:7))

Run the code above in your browser using DataLab