R/plotensembles.R

Defines functions plotensembles

Documented in plotensembles

# R-Code to calculate Q10-value based on SCAPE Copyright (C) 2013 Fabian Gans,
# Miguel Mahecha This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at your option)
# any later version.  This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
# Public License for more details.  You should have received a copy of the GNU
# General Public License along with this program.  If not, see
# <http://www.gnu.org/licenses/>.

#' plot the decomposed series
#'
#' @description
#' Function that creates plots of the surrogates of the low-freuquency component of the respiration and temprature data
#' @param result list: Results list generated by getQ10
#'
#' @return
#' @export
#'
#' @examples
plotensembles <- function(result) {
  DAT <- result$DAT
  ens <- result$surrogates
  par(mfrow = c(2, 2))
  plot(1:nrow(DAT), DAT$rho - mean(DAT$rho), xlab = "n", ylab = "rho low frequencies")
  lines(1:nrow(DAT), DAT$rho.dec.lf, lwd = 3)
  for (i in 1:dim(ens[[1]])[2]) {
    lines(1:nrow(DAT), ens$rho.dec.lf[, i], col = i + 1)
  }

  plot(1:nrow(DAT), DAT$rho.dec.hf, lwd = 3, "l", xlab = "n", ylab = "rho high frequencies")
  for (i in 1:dim(ens[[1]])[2]) {
    lines(1:nrow(DAT), ens$rho.dec.hf[, i], col = i + 1)
  }
  plot(1:nrow(DAT), DAT$tau - mean(DAT$tau), xlab = "n", ylab = "tau low frequencies")
  lines(1:nrow(DAT), DAT$tau.dec.lf, lwd = 3, "l")
  for (i in 1:dim(ens[[1]])[2]) {
    lines(1:nrow(DAT), ens$tau.dec.lf[, i], col = i + 1)
  }

  plot(1:nrow(DAT), DAT$tau.dec.hf, lwd = 3, "l", xlab = "n", ylab = "tau high frequencies")
  for (i in 1:dim(ens[[1]])[2]) {
    lines(1:nrow(DAT), ens$tau.dec.hf[, i], col = i + 1)
  }
}
dpabon/ecofunr documentation built on July 15, 2020, 12:58 p.m.