IVplot: IVplot

IVplotR Documentation

IVplot

Description

Makes a barchart of IV values

Usage

IVplot(
  object,
  top = NA,
  IVargs = NA,
  parts = FALSE,
  compare = NA,
  labels = NA,
  colors = c("darkgreen", "green", "yellow"),
  ...
)

Arguments

object

Either a data.frame which is the output of IV, or an object of class NPSForVeg, or a list of objects of class NPSForVeg.

top

Defaults to NA. An integer. Indicates the number of species that should be included from each dataset in the graph (see compare). For a single dataset the species with the largest total IV values are selected. When multiple datasets are compared, the top species in each dataset are selected, which can result in more species than top included in the final graph - e.g. if top=3 and two datasets are used, up to six species can be included in the graph, depeding on the amount of overlap it the top three species. If top=NA all species are displayed.

IVargs

A required list, defaults to NA. The arguments in this list are passed to IV and are used to generate the data for the graph. Any argument that is valid for IV can be in this list, and should be written in arguement=value format e.g. IVargs=list(group="trees", years=c(2010:2013))

parts

Logical value, defaults to FALSE. Indicates if the components of IV (Density, Size and Distribution) should be shown on the graph.

compare

A list of lists. Defaults to NA. This can be used to compare the IV values from several different datasets, such as trees from different parks, different time periods, or trees, sapings and seedlings from the same park. Each list will be passed on to IV, and can contain any arguments that are valid for that function. Entries in the list should be written in argument=value format e.g. compare=list( list(object=CATO, group="saplings", years=c(2010:2013)), list(object=CATO, group="seedlings", years=c(2010:2013)) ). Any number of datasets can be added using compare.

labels

A character vector, defaults to NA. Labels for each dataset, only used when compare is not NA

colors

Colors for the graph.

...

Other arguments passed to barchart in the lattice package.

Details

This function uses the barchart function in the lattice package to create a horizontal barchart that displays IV values. The format of the display varies depending on the type of data to be displayed. If only a single dataset is considered (compare=NA), and parts=FALSE, then a simple horizontal bar chart is produced. If parts=TRUE a stacked bar chart is produced. Each component of IV: density, size and distribution, is shown in a different color.

If two or more datasets are used, and parts=FALSE then all results are graphed in a single panel. Each dataset is a different color, and the legend uses the contents of labels to identify each dataset. If parts=TRUE then each dataset is plotted in a separate panel, and the panel title is determined by labels. Within each panel, the three components of IV will each have a separate color, which will be consistent between panels.

Value

Returns a barchart

See Also

IV


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