subset.mob_in: Subset the rows of the mob data input object

View source: R/mobr.R

subset.mob_inR 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 make_mob_in

subset

expression indicating elements or rows to keep: missing values are taken as false.

type

specifies the type of object the argument subset specifies, may be: string, integer, or logical, defaults to string

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')

MoBiodiv/mobr documentation built on Jan. 31, 2024, 6:15 p.m.