plot_cop_surf {cylcop}R Documentation

Surface Plot or Heat Map of the Distribution or the Density of a Copula

Description

This function plots the distribution or the density of a copula. It can produce a surface plot using either functions from the 'rgl' or from the 'plotly' package, or it can produce a heat map using functions from 'ggplot2'.

Usage

plot_cop_surf(
  copula,
  type = "pdf",
  plot_type = "rgl",
  resolution = 50,
  n_gridlines = 11
)

Arguments

copula

'cyl_copula' or a 'Copula' object from the package 'copula'.

type

character string describing what is plotted, either "pdf" or "cdf".

plot_type

character string describing what type of plot is produced. Available plot types are: "rgl": surface plot, "plotly": interactive surface plot, or "ggplot": heatmap

resolution

numeric value. The density or distribution will be calculated at resolution^2 points.

n_gridlines

numeric value giving the number of grid lines drawn in u and v direction.

Value

Depending on plot_type, a 'ggplot' object is returned, or a 'plotly' visualization or 'rgl' plot is produced.

References

Hodel FH, Fieberg JR (2022). “Circular-Linear Copulae for Animal Movement Data.” Methods in Ecology and Evolution. doi:10.1111/2041-210X.13821.

Hodel FH, Fieberg JR (2021). “Cylcop: An R Package for Circular-Linear Copulae with Angular Symmetry.” bioRxiv. doi:10.1101/2021.07.14.452253, https://www.biorxiv.org/content/10.1101/2021.07.14.452253v3/.

See Also

plot_cop_scat(), plot_track(), plot_joint_circ(), plot_joint_scat().

Examples

if(interactive()){
 plot_cop_surf(copula::frankCopula(2),
   type="pdf",
   plot_type="ggplot",
   resolution = 5
 )
 plot_cop_surf(copula::frankCopula(2),
   type="cdf",
   plot_type="ggplot",
   resolution = 5
 )

#opens a new window
  plot_cop_surf(cyl_quadsec(0.1),
    type="pdf",
    plot_type="rgl"
  )
  plot_cop_surf(cyl_quadsec(0.1),
    type="pdf",
    plot_type="rgl",
    n_gridlines = 60
  )

  plot_cop_surf(cyl_quadsec(0.1),
    type="pdf",
    plot_type="plotly",
    n_gridlines = 10,
    resolution = 10
  )
}


[Package cylcop version 0.2.0 Index]