This function subsets the rows of comm, env, and spat attributes of the mob_in object
# S3 method for mob_in
subset(x, subset, type = "string", drop_levels = FALSE, ...)
an object of class mob_in created by make_mob_in
expression indicating elements or rows to keep: missing values are taken as false.
specifies the type of object the argument subset
specifies, may be: string
, integer
, or logical
,
defaults to string
Boolean if TRUE unused levels are removed from factors in mob_in$env
parameters passed to other functions
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')
Run the code above in your browser using DataLab