Description Usage Arguments Examples
Select rows in a dataframe.
1 | select_rows(dataframe, rows, whole = FALSE, ..., cols_to_check = NULL)
|
dataframe |
a data.frame |
rows |
an atomic vector or function. Drop all but these rows.
If |
whole |
a logical. See the |
... |
additional arguments to |
cols_to_check |
a character vector. Allows for rows to be applied to a column subset of the dataframe. The default is to apply to all columns of the dataframe. |
1 2 3 4 | select_rows(iris, 1:10) # Select only first ten rows
select_rows(iris, c(TRUE,FALSE)) # Select only odd rows
iris2 <- iris; rownames(iris2) <- paste0("row", 1:nrow(iris2))
select_rows(iris, c("row10", "row51")) # Select rows by name
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.