SiteXSpec: SiteXSpec

SiteXSpecR Documentation

SiteXSpec

Description

Produces a Site X Species matrix. Each cell can contain a count, a measure of size or 1/0 indicating presence/abscence

Usage

SiteXSpec(
  object,
  group,
  years = NA,
  cycles = NA,
  values = "count",
  status = "alive",
  area = "plot",
  output = "dataframe",
  species = NA,
  plots = NA,
  plot.type = "active",
  Total = TRUE,
  common = F,
  ...
)

Arguments

object

either an object of class NPSForVeg or a list of such objects

group

A required character string indicating which group of plants should be selected. Options are: "trees", "saplings", "seedlings", "shrubs", "shseedlings" (indicating shrub seedlings), "vines", "herbs" or "cwd".

years

Defaults to NA. A numeric vector indicating which years should be included. This is passed on to getPlants.

cycles

Defaults to NA. A numeric vector indicating which cycles should be included. This is passed on to getPlants.

values

Determines the data contained in the Site X Species matrix. Possible values are:

"count"

The default. Each cell will include a count of the number of a given plant species in a given plot. For trees, saplings, seedlings, shrubs and shrub seedlings this is the number of plants. For vines, it is the number of trees a vine species grows on. For herbs it will be the number of quadrats the plant occurs in.

"size"

For trees and saplings this is the total basal area in m2 per ha. For tree seedlings and shrub seedlings it is the total height, and for herbs it is the average percent cover across all sampled quadrats. For shrubs and vines there is no defined size and the function will terminate with an error.

"presab"

Produces a presence/absence matrix. When a plant species is present in a given plot the corresponding cell value will 1, otherwise it is 0.

status

A requried character string indicating if user wants data from living or dead plants. Used only for trees, saplings and shrubs. Values of this argument are matched to the Status field in the Tree, Saplings or Shrubs slot. Acceptable options are:

"alive"

The default. Includes any plant with a status of "Alive", "Alive Standing", "Alive Broken", "Alive Leaning" ,"Alive Fallen","AB","AF","AL","AM","AS","RB","RF","RL","RS" or "TR"

"snag"

Standing dead tree only, Includes any plant with a status of "Dead", "Dead - Human Action", "Dead Leaning", "Dead Missing", "Dead Standing", "Dead - Too Small","DB","DL","DM",or"DS"

"other"

Includes any plant with a status of "Missing", "Missing - Presumed Dead", "Missing - Uncertain" , "Downgraded to Non-Sampled","ES","EX","NL","XO", "XP" or"XS"

"all"

Includes all plants

area

A character vector. Indicates if the values in the output are on a per plot or per area basis. This only works with counts, basal areas, and length of seedlings.

"plot"

The default. Each cell will be on a per plot basis. The only option for values="presab".

"ha"

Values will be on a per hectare basis

"ac"

values will be on a per acre basis

output

Either "dataframe" or "list". Determines the output type when object is a list. "dataframe", the default, indicates the output from all of NSPForVeg objects should be a single large data.frame, containing all sites and species from all NPSForVeg objects. "list" will return a list where each element of the list is a data.frame from a single NPSForVeg object, and each element is named based on that object's ParkCode slot.

species

A character vector of names. Defaults to NA. When not NA only species included in species will be included in the matrix. If a name is in species, but is not present in the data, it will not appear in the output.

plots

A character vector of plot names. Defaults to NA. When not NA only plots included in plots will be included in the matrix. If a plot name is in plots, but is not present in the data, it will not appear in the output.

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"

Events from all types of plots are returned.

"active"

The default. 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.

Total

Logical value. Determine if a "Total" column will be included in the output. Defaults to TRUE.

common

Defaults to FALSE. Indicates if common names should be used rather than Latin names.

...

Other arguments passed on to getPlants

Details

This function will first call getPlants to retrieve the plant data and getEvents to retrieve the event data. Then a site X species matrix will be created. Values in the cells are determined by the option selected with values. Each row corresponds to a different plot and each column to a different species.

Note that species can be a vector of common or Latin names. If common names are used then common=TRUE must be included in the function call.


NCRN/NPSForVeg documentation built on June 7, 2024, 1:01 p.m.