getPlots: getPlots

getPlotsR Documentation

getPlots

Description

Returns the contents of the Plots slot of an NPSForVeg object. The returned data can be filtered to meet various criteria.

Usage

getPlots(
  object,
  type = "active",
  visits = NA,
  years = NA,
  cycles = NA,
  plots = NA,
  parks = NA,
  subparks = NA,
  events = NA,
  output = "dataframe"
)

Arguments

object

An NPSForVeg object or a list of such objects.

type

One of three options indicating the type of plots to be considered. Must be in quotes. Options are:

"active"

The default. Only returns data for plots which are listed as active in the Plots$Location_Status field.

"all"

Returns data from all types of plots.

"retired"

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

visits

A numeric vector. Returns only data from plots where the number of plot visits matches one of the values in visits. The number of visits to a plot is determined by the Event_Count column in the Events slot.

years

A numeric vector. Returns only plot data from plots where the years the plot was visited matches one of the values in years. The year a visit takes place is determined by the Event_Year column in the Events slot.

cycles

A numeric vector. Returns only plot data from plots where the cycle the plot was visited matches one of the values in cycles. The cycle a visit takes place is determined by the Cycle column in the Events slot.

parks

A character vector. Returns only data from plots where the park the plot is in matches one of the values in parks. The park a plot is located in is determined by the Unit_Code column in the Plots slot.

subparks

A character vector. Returns only data from plots where the sub-park the plot is in matches one of the values in subparks. The sub-park a plot is located in is determined by the Subunit_Code column in the Plots slot.

events

A data.frame of events data like that produced by getEvents. Only used by the data.frame method when filtering by year or cycle. Typically this is automatically generated directly from the NPSForVeg objects.

output

Either "dataframe" (the default) or "list". Note that this must be in quotes. Determines the type of output from the function. Only used when the input object is a list.

Details

This function returns plot data either from a single NPSForVeg object or a list of such objects. The default output is a data.frame. However, if object is a list and output is "list" then a list of data.frames will be returned.

Examples

## Not run: 
netn <- importNETN("C:/NETN/R_Dev/data/NPSForVeg/NETN")

acad_mdiE <- getPlots(netn, subparks = "ACAD_MDI_East")

SARA22 <- getPlots(netn, years = 2022, parks = "SARA")

## End(Not run)


NCRN/NPSForVeg documentation built on Nov. 30, 2024, 7:32 a.m.