ChangeMatrix: ChangeMatrix

ChangeMatrixR Documentation

ChangeMatrix

Description

Produces a matrix which indicates the change in some measure of plant abundance between two time periods

Usage

ChangeMatrix(
  object,
  group,
  years1,
  years2,
  plots = NA,
  type = "active",
  species = NA,
  values = "count",
  output = "dataframe",
  ...
)

Arguments

object

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

years1

A numeric vector indicating the first set of years to be included.

years2

A numeric vector indicating the second set of years to be included.

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.

type

Passed to getPlots. One of three options that indicate what type of plots are to be considered. Must be in quotes. Options are:

"active"

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

"all"

The default. Returns names from all types of plots.

"retired

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

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.

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. For tree seedlings and shrub seedlings it is the total height, and for herbs it is the total percent cover across all 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.

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.

...

Other arguments passed on to SiteXSpec

groups

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

Details

This function will first call SiteXSpec to create site by species matrices for each of the two time periods. The output matrix will then be created by subtracting the values from time 1 from the values from time 2. While it is generally assumed that the two time periods do not overlap and that years2 are later than years1, this is not enforced and the user can enter any sets of years they like.

Additional arguments accepted by SiteXSpec or getPlants can be used as well. Currently using the cycles argument will result in errors. 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 March 26, 2024, 7:13 a.m.