select_rows: Select rows in a dataframe.

Description Usage Arguments Examples

Description

Select rows in a dataframe.

Usage

1

Arguments

dataframe

a data.frame

rows

an atomic vector or function. Drop all but these rows. If rows is a function, the rows will be selected based on the whole parameter. If whole = TRUE, the whole dataframe will be passed in, and the resulting row indices (character, numeric, or logical) will be selected. If whole = FALSE (the default) the function will be applied to each row and the result will be expected to be a logical, with only the rows returning TRUE being selected.

whole

a logical. See the rows parameter. The default is FALSE.

...

additional arguments to rows is that parameter is a function.

Examples

1
2
3
4
5
6
7
## Not run: 
select_rows()$run(iris, 1:10) # Select only first ten rows
select_rows()$run(iris, c(TRUE,FALSE)) # Select only odd rows
iris2 <- iris; rownames(iris2) <- paste0("row", 1:nrow(iris2))
select_rows()$run(iris, c("row10", "row51")) # Select rows by name

## End(Not run)

syberia/syberiaMungebits2 documentation built on May 30, 2019, 10:42 p.m.