powered by
Returns rows/columns selected by name in an array-like object.
get_columns(x, ...)get_rows(x, ...)# S4 method for data.frame get_columns(x, select = NULL, ...)# S4 method for data.frame get_rows(x, select = NULL, ...)
get_rows(x, ...)
# S4 method for data.frame get_columns(x, select = NULL, ...)
# S4 method for data.frame get_rows(x, select = NULL, ...)
An object of the same sort as x.
x
An R object (should be a matrix or a data.frame).
matrix
data.frame
Further arguments to be passed to select.
select
A function to be applied to the row/colum names (e.g. startsWith()). Must return a single integer or logical vector.
function
startsWith()
integer
logical
N. Frerebeau
Other data preparation tools: append(), assign(), compact(), count(), detect(), discard(), keep(), seek()
append()
assign()
compact()
count()
detect()
discard()
keep()
seek()
## Seek columns seek_columns(iris, select = startsWith, prefix = "Sepal") ## Get columns x <- get_columns(iris, select = startsWith, prefix = "Sepal") head(x)
Run the code above in your browser using DataLab