getEvents: getEvents

getEventsR Documentation

getEvents

Description

This function gets the contents of the "Events" slot of an NPSForVeg object.

Usage

getEvents(
  object,
  plots = NA,
  years = NA,
  cycles = NA,
  plot.type = "all",
  output = "dataframe"
)

Arguments

object

Either an NPSForVeg object of a list of such objects.

plots

A character vector containing one or more plot names. Defaults to NA. If not NA then only events from the given plots will be returned.

years

A numeric vector containing one or more years. Defaults to NA. If not NA then only events from the given years will be returned.

cycles

A numeric vector containing one or more sampling cycles. Defaults to NA. If not NA then only events from the given sampling cycles will be returned.

plot.type

Passed on to getPlotNames and used to filter events so that only events from certain plot types are returned. One of three options are availbe (always ineclosed in quotes).

"all"

The default. Events from all types of plots are returned.

"active"

Only returns events from plots which are listed as active in the Plots$Location_Status field.

"retired

Only returns events from plots which are listed as retired in the Plots$Location_Status field.

output

Used type 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

This function returns the Events slot of an NPSForVeg object or a list of such objects. This can be filtered by specifying plots, years, or plot.type. If object is a single NPSForVeg object than a data.frame is returned. If object is a list and output is "dataframe" then a single data.frame with data from all NPSForVeg objects in the list is returned. If object is a list and output is "list" then a list will be returned. Each element of the list will be a data.frame with the Events slot of one of the NPSForVeg objects.

Value

The contents of an "Events" slot from one or more NPSForVeg objects either as a data.frame or a list. The output can be filtered by using the "plots", "years" or "plot.type" arguements.


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