select | R Documentation |
Subset data Take subset data for
select(data, i, ...)
## S3 method for class 'character'
select(data, i, ...)
## S3 method for class 'numeric'
select(data, i, ...)
## S3 method for class 'logical'
select(data, i, ...)
## S3 method for class 'data.frame'
select(data, i, j, drop = FALSE, ...)
## S3 method for class 'matrix'
select(data, i, j, drop = FALSE, ...)
## S3 method for class 'list'
select(data, i, j, drop = FALSE, ...)
data |
one vector, list, dataframe or matrix |
i |
element position for vector or list, row number for dataframe or matrix |
... |
ignore |
j |
column number for dataframe or matrix |
drop |
logical, whether to drop original format, default is FALSE |
selected data
x <- c('ab','bc','d')
x |> select(!grepl('a'))
x |> select(grepl('a'))
x |> select(!grepl('a'))
x |> select(grepl('a'))
x <- mtcars
x |> select(,!grepl('m',ignore.case = TRUE))
x |> select(grepl('m',ignore.case = TRUE),grepl('m',ignore.case = TRUE))
x |> select(!grepl('m',ignore.case = TRUE),!grepl('m',ignore.case = TRUE))
x |> select(grepl('a') & grepl('m'))
x |> select(grepl('a|m'))
x |> select(am ==1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.