plotCorrHist2D: correlationDataSets

View source: R/plotCorrHist2D.R

plotCorrHist2DR Documentation

correlationDataSets

Description

Plots 2D density plots to evaluate the relationship between two datasets. It also returns the R-square for the correlation

Usage

plotCorrHist2D(
  x,
  y,
  title = NULL,
  xlab = "x",
  ylab = "y",
  bins = 40,
  limx = NULL,
  limy = NULL,
  folder = NULL,
  file = "",
  breaks = waiver(),
  nrows = 2,
  ncols = 2,
  axisFont = 13,
  axisTitleFont = 13,
  titleFontSize = 15,
  legendTitleFont = 12,
  legendTextFont = 10,
  statFont = 4,
  table = FALSE,
  stat = TRUE,
  palette = "RdYlBu",
  tag = "year-item"
)

Arguments

x

First data set (x axis) (observed) as magpie object with one or more items in 3rd dimension

y

Second data set (y axis) (predicted) as magpie object with one or more items in 3rd dimension

title

title of plot

xlab

x axis title

ylab

y axis title

bins

number of bins in histogram

limx

limits y axis (if NULL, fitting limits are calculated within the function)

limy

limits x axis (if NULL, fitting limits are calculated within the function)

folder

path in which to save the plots. if "." is used, it is saved in the current working directory. If NULL, no plots are saved.

file

name of file

breaks

breaks of the legend. It can be a vector, waiver()=the ones from the transformation, NULL for no breaks

nrows

number of rows in pdf file where plots are printed

ncols

number of columns in pdf file where plots are printed

axisFont

Font size of text of axis of the correlation plot

axisTitleFont

Font size of title of axis of the correlation plot

titleFontSize

Font size of title of correlation plot

legendTitleFont

Font size of the title of the legend

legendTextFont

Font size of legend

statFont

font size r2-MAE label

table

Conditional to include table with statistics in the output. TRUE (includes it), FALSE (it doesn't)

stat

Conditional to include R2 and MAE on the fiure. TRUE (includes it), FALSE (it doesn't)

palette

palette selection for heatd maps based on the RColorBrewer library

tag

for multiple items in the second and third dimensions of the magpie object, should the title include "year", "item", "year-item".

Author(s)

Edna Molina Bacca

Examples

## Not run: 
x <- plotCorrHist2D(x, y, folder = ".")

## End(Not run)


pik-piam/luplot documentation built on Jan. 29, 2025, 12:30 a.m.