plotOrdScores: Pretty biplots for time series data

View source: R/plotOrdScores.R

plotOrdScoresR Documentation

Pretty biplots for time series data

Description

This function carries out ordination analysis and plots the ordination scores in two dimensions. The input file is a data frame with a series of regular time steps and data values at those time steps.

Usage

plotOrdScores(
  dataset,
  columns = NA,
  mintime = NA,
  maxtime = NA,
  noNAs = 0,
  color = "rainbow",
  lab.cols = 1,
  tim.cex = 1,
  add.pts = FALSE,
  indatformat = "%Y",
  outdatformat = "%y",
  main = "title",
  method = "pca",
  nmdsk = 2
)

Arguments

dataset

A data.frame in which the first column is numerical values representing time steps and subsequent columns are data values at those time steps.

columns

an integer or vector defining the column numbers of data to be included. Defaults to the entire data set.

mintime

a value representing the earliest time step to be included in the analysis. Defaults to first time step in data set.

maxtime

a value representing the last time step to be included in the analysis. Defaults to last time step in data set.

noNAs

a value between 0 and 1 representing the proportion of allowable NAs for any given time series. NA values are imputed with the mean across the time series for the ordination. Time series exceeding the proportion of NAs specified are removed from the analysis.

color

color options for the segments connecting time steps. Either "rainbow" (default) or "gray" are available.

lab.cols

color specification for the time step labels.

tim.cex

a value indicating scaling for the size of the time step labels.

add.pts

if TRUE, adds the PCA loadings or NMDS species on the ordination plot. Defaults to FALSE.

indatformat

a format in which the time steps are input, as defined in strptime. Defaults to year with century ("%Y").

outdatformat

a format as defined in strptime which represents the desired format for labeling the plot. Defaults to year without century ("%y").

method

the ordination method to be used in the analysis. Defaults to principal components analysis ("pca") using prcomp. Other option is non-metric multidimensional scaling ("nmds") using metaMDS.

nmdsk

an integer representing the number of dimensions to be used in metaMDS, if the NMDS method is specified.

Note

Data must be input in a data frame where rows represent time steps and columns represent data series.

  • The first columns contains a string of time units in any specified format.

  • Columns 2+ contain data values for the respective time steps.

References

Figure 1 in https://onlinelibrary.wiley.com/doi/full/10.1111/gcb.12894

Examples

## make traffic plot of Gulf of Mexico fishery landings

 plotOrdScores(GOMlandings)


mandykarnauskas/plotTimeSeries documentation built on Nov. 21, 2024, 12:34 p.m.