# 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_SRC_seasons <- function(X, ylim = c(0, 1), ...) { if (!is.null(X[[1]]$y)) { p <- nrow(X[[1]]$SRC) pch = c(21, 24) nodeplot(X[[1]]$SRC, xlim = c(1, p + 1), ylim = c(-1,1), pch = pch[1], col=10) } for (k in 2:4){ if (!is.null(X[[k]]$y)) { pch = c(21, 24) nodeplot(X[[k]]$SRC, xlim = c(1, p + 1), ylim = c(-1,1), pch = pch[1], col=10*k, add = TRUE, labels = FALSE) } } 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)) }