getCommons: getCommons

getCommonsR Documentation

getCommons

Description

gets the common names data.frame from one or more NPSForVeg objects.

Usage

getCommons(object, species = NA, nativity = "all", output = "dataframe")

Arguments

object

Either a data.frame like that stored in the Commons slot, an NPSForVeg object or a list of such objects.

species

A character vector of species Latin names. Will only return data from those species.

nativity

Indicates the nativity of the desired species. Three options are available:

"native"

Only native species are returned.

"exotic"

Only exotic species are returned.

"all"

The default. Species are returned regardless of nativity.

output

Used when "object" is a list, to determine if the output is a data.frame or a list. Can be either "dataframe" (the default), or "list". Needs to be in quotes.

Details

When the "object" is a single NPSForVeg object this function will return the data.frame in the "Commons" slot. When "object" is a list and "output" is "dataframe" a combined data.frame with the "Commons" slot from all NPSForVeg elements is returned. This data.frame is filtered so that identical rows are not returned. If a species is present in more than one of the data.frames, and the metadata for the speices (e.g. native vs exotic) differs between them, then the species will be returned twice, once with each set of metadata. If the "object" is a list and "output" is "list" then a list is returned. Each element of the list will be the "Commons" slot from one the input NPForVeg objects.

Value

Either a data.frame or a list containing the contents of the "Commons" slot for one or more NPSForVeg objects.


NCRN/NPSForVeg documentation built on March 26, 2024, 7:13 a.m.