subset.mob_in {mobr} | R Documentation |
Subset the rows of the mob data input object
Description
This function subsets the rows of comm, env, and spat attributes of the mob_in object
Usage
## S3 method for class 'mob_in'
subset(x, subset, type = "string", drop_levels = FALSE, ...)
Arguments
x |
an object of class mob_in created by |
subset |
expression indicating elements or rows to keep: missing values are taken as false. |
type |
specifies the type of object the argument |
drop_levels |
Boolean if TRUE unused levels are removed from factors in mob_in$env |
... |
parameters passed to other functions |
Examples
data(inv_comm)
data(inv_plot_attr)
inv_mob_in = make_mob_in(inv_comm, inv_plot_attr, coord_names = c('x', 'y'))
subset(inv_mob_in, group == 'invaded')
subset(inv_mob_in, 1:4, type='integer')
subset(inv_mob_in, 1:4, type='integer', drop_levels=TRUE)
sub_log = c(TRUE, FALSE, TRUE, rep(FALSE, nrow(inv_mob_in$comm) - 3))
subset(inv_mob_in, sub_log, type='logical')
[Package mobr version 2.0.2 Index]