plot_2Dheatmap: Heatmat plot for 2D smooth effects for 'pffr' models

Description Usage Arguments Value

View source: R/effect_plots.R

Description

Plots heatmap plots for 2D smooth effects for a function-on-scalar model fitted with pffr. Additionally, Marra \& Wood (2012) or bootstrapped-based confidence intervals (CIs) can be plotted, specifying the plot_type argument.

Usage

1
2
3
4
5
6
plot_2Dheatmap(model, plot_type = 1, plot_ci = TRUE,
  plot_ci_type = "all", alpha = 0.05, CIs_list, select,
  lowCol = "blue", highCol = "red", legend_limits,
  legend_position = "right", xlab, ylab, main, sub = NULL,
  effect_label, base_size = 11, outer_fontsize = 15, newpage = TRUE,
  ...)

Arguments

model

Function-on-scalar model fitted with pffr

plot_type

Either 1 (plotting CIs after Marra \& Wood (2012)) or 2 (bootstrap-based CIs, by specyfing CIs_list). Defaults to 1.

plot_ci

If TRUE CIs are plotted. Only used if plot_type = 1.

plot_ci_type

Only used if plot_ci = TRUE. One of c('all','lower','upper'). Determines if the effect and the CI boundaries ('all'), only the lower or only the upper boundary ('lower'/'upper') should be plotted

alpha

(1-alpha) CIs are calculated. The default 0.05 leads to 95% CIs. Only used if plot_type = 1.

CIs_list

Output of function calc_bootstrapCIs. Only necessary if plot_type = 2.

select

Index of smooth term to be plotted. If a vector of length two is passed, then the difference of the second smooth minus the first smooth will be plotted. Note that CIs from plot_type == 1 are suppressed in this case. However, using the CIs_list argument one can still plot boostrapped CIs for such a difference of smooths, by passing a list with only one CI element. Such a CI element can be obtained by using calc_singleBootstrapCI, using the select argument.

lowCol, highCol

Colors defining the color gradient of the plots

legend_limits

Optional vector specifying the limits of the color scale, e.g. c(-2,2)

legend_position

Either "bottom", "right" or "none"

xlab

Optional parameters for overwriting the default plot parameters

ylab

Optional parameters for overwriting the default plot parameters

main

Optional parameters for overwriting the default plot parameters

sub

Optional subtitle of the plot

effect_label

Used in the main title of the plot as 'effect_label with global 95% CI'. Only used if main is not specified.

base_size

Size of plot elements. see theme_bw. Defaults to 11.

outer_fontsize

Fontsize of the main and sub which are outer of the single ggplots. Defaults to 15.

newpage

See grid_arrange_shared_legend function. Should be set to FALSE when exporting the plot, e.g. using pdf.

...

Further arguments passed to theme

Value

The function silently returns the ggplot object


bauer-alex/FoSIntro documentation built on Feb. 11, 2022, 8:33 a.m.