GraphicsPrediction: Plots the time series

View source: R/GraphicsPrediction.R

GraphicsPredictionR Documentation

Plots the time series

Description

This function takes into account the data used to estimate and the data used to predict.

Usage

GraphicsPrediction(
  especie.All,
  names.especie,
  ExpectedValue.All,
  VarianceValue.All,
  Pred,
  Plot.Tipe,
  Detail
)

Arguments

especie.All

Matrix that contains at row i the bacterial taxa of bacteria i at all time points.

names.especie

Vector with the names of the bacteria in the same order that are placed in the especie matrix.

ExpectedValue.All

Matrix that contains at row i the expected value of the bacterial taxa i at all time points. The bacteria must be placed in the same order than in especie. This matrix must comply: dim(ExpectedValue.All)[2]=dim(especie.All)[2]-1

VarianceValue.All

Matrix that contains at row i the variance of the bacterial taxa i at all time points. The bacteria must be placed in the same order than in especie.This matrix must comply: dim(VarianceValue.All)[2]=dim(especie.All)[2]-1

Pred

Number. Indicates the time point in which we start predicting.

Plot.Tipe

Character. If Plot.Tipe==Data the function displays a graphic of the dataset, if Plot.Tipe==DataExpected the function displays a graphic of the data and the expected values, if Plot.Tipe==All the function displays a graphic with the data, the expected values and the variance.If Plot.Tipe==Var the function returns the boxplot of the variance at each time point and the variance of each bacteria. If Plot.Tipe==OnlyVar the function returns the boxplots of the variance at each time points.

Detail

Character. If Detail==no the graphic obtained when Plot.Tipe==DataExpected and Plot.Tipe==All will have the same y axis for all the taxa. If Detail==yes these functions will have different y axis.

Value

Returns the indicated plots with a vertical line when the time point is equal to Pred-1, in Pred the prediction has started.

Examples



names.especie=c("Bact1", "Bact2", "Bact3")
especie.All=cbind(c(0.5,0.3,0.2),
                c(0.6,0.3,0.1),
                c(0.4,0.1,0.5),
                c(0.4,0.1,0.5),
                c(0.4,0.1,0.5),
                c(0.4,0.1,0.5))
ExpectedValue.All=especie.All[,-1]+0.1
VarianceValue.All=matrix(c(runif(15,0.001,0.004)), 3,5)
Pred=4

GraphicsPrediction(especie.All,
                  names.especie,
                  ExpectedValue.All,
                  VarianceValue.All ,
                  Pred,
                  "Data",
                  "no")

GraphicsPrediction(especie.All,
                 names.especie,
                 ExpectedValue.All,
                 VarianceValue.All ,
                 Pred,
                 "DataExpected",
                 "no")

GraphicsPrediction(especie.All,
                 names.especie,
                 ExpectedValue.All,
                 VarianceValue.All ,
                 Pred,
                 "All",
                 "no")

GraphicsPrediction(especie.All,
                 names.especie,
                 ExpectedValue.All,
                 VarianceValue.All ,
                 Pred,
                 "Var",
                 "no")

GraphicsPrediction(especie.All,
                 names.especie,
                 ExpectedValue.All,
                 VarianceValue.All ,
                 Pred,
                 "OnlyVar",
                 "no")



CoDaLoMic documentation built on April 12, 2025, 2:18 a.m.