Learn R Programming

AnimalAPD (version 1.0.0)

plotAPDcorr: Plot APDcorr Posterior Samples and Predicted Effects

Description

Plot histogram of posterior distribution samples and/or predicted effects of parameter estimated from APDREcorr function

Usage

plotAPDcorr(
  model,
  hist = TRUE,
  effects = TRUE,
  histcol = c("cyan4", "cyan4", "cyan4", "cyan4"),
  linecol = "red",
  effectcol = c("cyan4", "cyan4", "cyan4", "cyan4"),
  yname = "Focal",
  xname = c("C1", "C2", "C3", "C4")
)

Arguments

model

Object of class APD of model output from APDREcorr function

hist

Logical argument for whether to plot histogram of posterior distribution samples; default=TRUE

effects

Logical argument for whether to plot predicted effects; default=TRUE

histcol

Colour for posterior distribution histogram

linecol

Colour for 95% HDI line on posterior distribution histogram

effectcol

Colour for 95% HDI ribbon in line plot of predicted effects

yname

Character vector of name of focal, to be used in the y axis labels

xname

Character vector of name(s) of contingent(s), to be used in the x axis labels

Value

Histogram plot(s) of samples from posterior distribution for estimated relationship between focal and contingent(s), if plothist=TRUE

Plot of predicted effects (mean and 95% highest density interval) for relationship between focal APD and contingent(s) APD, if ploteffects=TRUE

Examples

Run this code
# NOT RUN {
data(wolfexample)
data(boarexample)
# }
# NOT RUN {
 WolfBoarAPDc<-APDREcorr(focal=wolfexample$Radians, cont1=boarexample$Radians,
    RE1=wolfexample$SamplingPeriod)
    plotAPDcorr(WolfBoarAPDc, yname="Wolf", xname="Boar") 
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab