rm(list=ls()) library(SpatialExtremes) data(rainfall) ## We are going to plot a bunch of circle centered at weather ## stations, whose radius is proportional to the deviation from the ## areal mean of the gev parameters and whose color is blue or red ## depending if we're below or above the areal mean ## This is similar with what we've done in SpatialTrends.R but with ## each GEV parameters, i.e., location, scale and shape---thus 3 plots ## Fit a generalized extreme value distribution at each location gev.mles <- apply(rain, 2, gevmle) ## <<-- if you don't understand this line please ask par(mfrow = c(1, 3)) ## <<-- divide the graphic window in a (1 x 3) matrix norm.factor <- c(0.5, 2, 50) for (i in 1:3){ ## Plot Switzerland usign an existing function---always a good idea to ## start with that swiss(city = TRUE) ## Do actually the symbol plot areal.mean <- mean(gev.mles[i,]) col <- c("red", "blue")[2 - (gev.mles[i,] >= areal.mean)] radius <- norm.factor[i] * abs(gev.mles[i,] - areal.mean) symbols(coord[,-3], circles = radius, inches = FALSE, add = TRUE, bg = col) }