slice | R Documentation |
ir
objects using their positionsSubset rows in ir
objects using their positions
slice.ir(.data, ..., .preserve = FALSE)
slice_sample.ir(.data, ..., n, prop, weight_by = NULL, replace = FALSE)
.data |
An object of class |
... |
For Provide either positive values to keep, or negative values to drop. The values provided must be either all positive or all negative. Indices beyond the number of rows in the input are silently ignored. For |
.preserve |
Relevant when the |
n , prop |
Provide either A negative value of |
weight_by |
< |
replace |
Should sampling be performed with ( |
.data
with subsetted rows.
dplyr::slice()
Other tidyverse:
arrange.ir()
,
distinct.ir()
,
extract.ir()
,
filter-joins
,
filter.ir()
,
group_by
,
mutate
,
mutate-joins
,
nest
,
pivot_longer.ir()
,
pivot_wider.ir()
,
rename
,
rowwise.ir()
,
select.ir()
,
separate.ir()
,
separate_rows.ir()
,
summarize
,
unite.ir()
## slice
dplyr::slice(ir_sample_data, 1:5)
dplyr::slice_min(ir_sample_data, holocellulose, n = 3)
dplyr::slice_max(ir_sample_data, holocellulose, n = 3)
dplyr::slice_head(ir_sample_data, n = 5)
dplyr::slice_tail(ir_sample_data, n = 5)
## slice_sample
set.seed(234)
dplyr::slice_sample(ir_sample_data, n = 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.