# R code developed by: # International Research Institute for Climate and Society # Columbia University in the City of New York, USA # Last update: Jully 3, 2013 # -------------------------------------------------------------------------------- # Dependancies : (see each function for further details) # -- Function "nodeplot.R" from package "sensitivity" # -------------------------------------------------------------------------------- # Results : # -- Plot the SRC contained in matrix X for the four seasons # -------------------------------------------------------------------------------- # Parameters : # -- X a list of all the SRC indices # -------------------------------------------------------------------------------- # Actions : # -- Plot the four sets of SRC with function nodeplot # -------------------------------------------------------------------------------- plot_sobol_seasons <- function(X, ylim = c(0, 1), ...) { x<-X[[1]] if (!is.null(x$y)) { p <- ncol(x$X1) pch = c(21, 24) nodeplot(x$S, xlim = c(1, p + 1), ylim = ylim, pch = pch[1], col=10) nodeplot(x$T, xlim = c(1, p + 1), ylim = ylim, labels = FALSE, pch = pch[2], col=10, at = (1:p)+.3, add = TRUE) } for (k in 2:4){ x<-X[[k]] if (!is.null(X[[k]]$y)) { p <- ncol(x$X1) pch = c(21, 24) nodeplot(X[[k]]$S, xlim = c(1, p + 1), ylim = ylim, pch = pch[1], col=10*k, add = TRUE, labels = FALSE) nodeplot(X[[k]]$T, xlim = c(1, p + 1), ylim = ylim, labels = FALSE, pch = pch[2], col=10*k, at = (1:p)+.3, add = TRUE) } } legend(x = "topright", legend = c("main effect", "total effect"), pch = pch) legend(x = "topleft", legend = c("spring", "summer", "autumn","winter"), col=c(10,20,30,40), lwd=c(2.5,2.5,2.5,2.5)) }