slice | R Documentation |
Subset to a specific number of samples.
## S3 method for class 'rbiom'
slice(biom, ..., clone = TRUE)
## S3 method for class 'rbiom'
slice_head(biom, ..., clone = TRUE)
## S3 method for class 'rbiom'
slice_tail(biom, ..., clone = TRUE)
## S3 method for class 'rbiom'
slice_min(biom, ..., clone = TRUE)
## S3 method for class 'rbiom'
slice_max(biom, ..., clone = TRUE)
## S3 method for class 'rbiom'
slice_sample(biom, ..., clone = TRUE)
biom |
An rbiom object, such as from |
... |
Passed on to |
clone |
Create a copy of |
An rbiom object.
Other transformations:
mutate()
,
rarefy()
,
rarefy_cols()
,
subset()
,
with()
library(rbiom)
# The last 3 samples in the metadata table.
biom <- slice_tail(hmp50, n = 3)
biom$metadata
# The 3 oldest subjects sampled.
biom <- slice_max(hmp50, Age, n = 3)
biom$metadata
# Pick 3 samples at random.
biom <- slice_sample(hmp50, n = 3)
biom$metadata
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.