dens: dens

densR Documentation

dens

Description

calculates mean "density" in abundance, size and occupancy and 95% confidence intervals.

Usage

dens(
  object,
  group,
  years,
  values = "count",
  density = TRUE,
  species = NA,
  plots = NA,
  area = "count",
  plotarea = NA,
  subplots = NA,
  subplotarea = NA,
  subplotnumber = NA,
  output = "dataframe",
  ...
)

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"(indicated shrub seedlings), "vines", or "herbs'.

years

Defaults to NA. A required numeric vector indicating which years should be included.

values

Defaults to "count". Passed on to SiteXSpec Indicates the type of measurement which is calculated by the SiteXSpec function. Options are:

"count"

The default. 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 the number of trees a vine species grows on, and for herbs it will be the number of quadrats the plant occurs in.

"size"

For trees and saplings this is the total basal area per plot 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"

A presence-absence matrix. When a plant species is present in a given plot, the corresponding cell value will be 1. Otherwise it will be 0.

density

Logical Value, Only used when values="count". Defaults to TRUE, presents results on per hectare basis. FALSE presents results on a per plot basis. For values="presab" this is always treated as FALSE and results are always a proportion of plots.

species

Character vector, defaults to NA. Passed on to SiteXSpec and from there to getPlants to limit hte output to one or more designated species.

plots

Character vecltor, defaults to NA. When not NA indicates which plots should be used in the analysis. Otherwise all plots are sused

area

A character vector. Used when values="size" Determines 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 ona per plot basis. The only option for values="presab".

"ha"

Values will be on a per hectare basis

"ac"

values will be in a per acre basis

plotarea

Single number. Defaults to NA. Used when the input object is a list and the ouput is a data.frame and is on a per plot basis. This indicates how big the total sampled area per plots is assuemed to be. If NA#' the plot size from the first object in the list is used.

subplots

Single number. Defaults to NA. Used when the input object is a list and the ouput is a data.frame and values are "presab". This indicates how may subplot are assumed to be sampled. If NA the number of subplots from the first object in the list is used.

subplotarea

Vector of numbers. Indicates how many subplots were sampled for each plot. If left as NA will be automatically determined using getSubplotCount

subplotnumber

Vector of number Inidcates how large an area was sampled for each plot. If left as NA will be automatically determined using getSubplotCount

output

Either "dataframe" or "list". Determines the output type When object is a list. "Dataframe",the default, indicates the NSPForVeg objects should combined and treated as a single dataset and return a single data.frame. "List" will return a list where each element of the list is a data.frame with resutls from a single NSPForVeg object, and each element is named based on that object's ParkCode slot.

...

Any additional arguments which are valid for either SiteXSpec or getPlants.

Details

This function calculates the mean and 95% confidence values for a given measurement for one or more object of class NPSForVeg. The raw data for this calculation is acquired by calling SiteXSpec which will in turn call getPlants. The method of calculating the results depends on the values argument. If values="count" the data is assuemd to follow a negative binomial distribution. The mean and the intervals are calculated using the glm.nb function in the MASS package. Note that when a species if found in few of the plots, this function will often return a warning. If values="size" no distribution is assumed for the underlying data. Instead, confidence intervals and determined using 1000 bootstrap replicates. Note that if a species is relatively rare this can lead to the 95 If values="presab" data is treat as being binomial and confidence intervals are detemined using glm.

Complications arise when the sampling effort is uneven in the data you are analyzing. This can happen in a variety of ways. If a subplot is not sampled during an event, perhaps due to a safety concern, the the analysis need to take into account that some of the data is missing. Similarly, if the design of the plot changes, adding or remving subplots or changing the area sampled similar problems occur. Finally, if you are combining data from areas with differnt plot designs, this also must be taken into account.

When working with a single park, or a list of parks when output="list", the function will use an offset of area sampled when values = "count", will use input data on a per ha or per acre basis (determined by area) when values="size" and will use an offset based on subplots sampled when values="presab". Areas and subplots sampled are specified using the subplotarea and subplotnumber argurments, but will be automatically determined with a call to getSubplotCount if left as NA

When the input is a list, output="list" data from muliple parks are combined. Differences in sampled area are accounted for in the same manner as above. However, if the output is desired on a per plot basis rather than a per area basis (always the case when values="preasb"), then it is necessary to assume a particular plot size or number of subplots. This is particularly true when combining parks with different areas sampled. This is done through the plotarea and subplots arguments.

Value

Returns a data.frame,or a list or them, which indicate the mean and 95% confidence intervals of the requested measurement.


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