varianceSummary: Summary of the variance analysis results.

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/varianceSummary.R

Description

Illustrates the results of the variance analysis performed with function varianceAnalysis based on a spatial subsetting of the study area.

Usage

1
2
3
varianceSummary(..., component = 1L, drawBoxplot = TRUE, regions = c(6L,
  6L), addWorld = TRUE, outline = FALSE, parMap = list(mar = c(0, 0, 0,
  0)), parGraph = list(mar = c(2.5, 2.5, 3, 1)))

Arguments

...

A single or multiple objects returned by function varianceAnalysis.

component

Integer indicating the number of the component analyzed in function varianceAnalysis. Choices are 1 (Component1), 2 (Component2) or 3 (Component12).

drawBoxplot

Logical. If FALSE, points of the spatial mean are plotted.

regions

Either a SpatialPolygons object (see SpatialPolygons) or integer of length 2 indicating the number of chunks in which to divide longitudes and latitudes.

addWorld

Logical that indicates if the lines of the world should be drawn on the map.

outline

Same as in boxplot.

parMap

List of graphical parameters affecting the output map.

parGraph

List of graphical parameters affecting the output boxplot/pointplot.

Details

When parameter 'regions' is an integer (not a SpatialPolygons object) a grid of polygons is created using function union from package raster.

Boxes/points of the total standard deviation in each region is are also plotted (over 100) with colored background.

The output boxplot shows the spatial spread of the results in each region. On the contrary, if paramter drawBoxplot = FALSE, the output graph only shows points of the spatial mean for each region. However, might be useful when multiple results are compared, as the resulting graph has a cleaner appearance.

Value

This function returns a map of the spatial subset performed and a graph of the variance results for each spatial subset. Additionally, returns a matrix (or list of matrixes) with the summary of the results.

Author(s)

M. Iturbide

See Also

varianceAnalysis

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
## Load climate data
destfile <- tempfile()
data.url <- "https://raw.githubusercontent.com/SantanderMetGroup/mopa/master/data/biostack.rda"
download.file(data.url, destfile)
load(destfile, verbose = TRUE)

## Fitted models
data(mods)
?mods

## Model prediction and analysis of the variability in projections
newClim <- lapply(1:4, function(x){
crop(biostack$future[[x]], extent(-10, 5, 35, 60))
})

prdRS.fut <- mopaPredict(models = mods, newClim = newClim)
result <- varianceAnalysis(prdRS.fut, "PA", "newClim")

## Summary of the results
varianceSummary(result, component = 2, regions = c(4, 6))

## Use a SpatialPolygons object for spatial subsetting

destfile <- tempfile()
data.url <- "https://github.com/SantanderMetGroup/visualizeR/raw/devel/data/PRUDENCEregions.rda"
download.file(data.url, destfile)
load(destfile, verbose = TRUE)
varianceSummary("mars" = result, component = 2, regions = PRUDENCEregions)

mopa documentation built on May 2, 2019, 6:47 a.m.

Related to varianceSummary in mopa...