powered by
Use regexes to get all the elements between two points.
grab_index(x, from = NULL, to = NULL, ...)# S3 method for character grab_index(x, from = NULL, to = NULL, ...)# S3 method for default grab_index(x, from = NULL, to = NULL, ...)# S3 method for list grab_index(x, from = NULL, to = NULL, ...)# S3 method for data.frame grab_index(x, from = NULL, to = NULL, ...)# S3 method for matrix grab_index(x, from = NULL, to = NULL, ...)
# S3 method for character grab_index(x, from = NULL, to = NULL, ...)
# S3 method for default grab_index(x, from = NULL, to = NULL, ...)
# S3 method for list grab_index(x, from = NULL, to = NULL, ...)
# S3 method for data.frame grab_index(x, from = NULL, to = NULL, ...)
# S3 method for matrix grab_index(x, from = NULL, to = NULL, ...)
Returns a subset of the original data set.
A character vector, data.frame, or list.
data.frame
An integer to start from (if NULL defaults to the first element/row).
NULL
A integer to get up to (if NULL defaults to the last element/row).
ignored.
grab_index(DATA, from = 2, to = 4) grab_index(DATA$state, from = 2, to = 4) grab_index(DATA$state, from = 2) grab_index(DATA$state, to = 4) grab_index(matrix(1:100, nrow = 10), 2, 4)
Run the code above in your browser using DataLab