Skip to content

Commit

Permalink
Merge branch 'devel'
Browse files Browse the repository at this point in the history
Establish version
  • Loading branch information
mdfrias committed May 5, 2017
2 parents 6366433 + fa6295b commit 0e35e86
Show file tree
Hide file tree
Showing 34 changed files with 378 additions and 249 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
.RData
ignore/
.Rbuildignore
.*
.*
visualizeR.Rproj
20 changes: 10 additions & 10 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,24 @@ Suggests:
knitr
Type: Package
Title: Visualizing and Communicating Uncertainty in Seasonal Climate Prediction
Version: 0.2-0
Date: 2016-03-06
Version: 0.2.1
Date: 2017-05-05
Authors@R: as.person(c(
"Maria Dolores Frias <[email protected]> [ctb, cre]",
"Jesus Fernandez <[email protected]> [ctb]",
"Joaquin Bedia <[email protected]> [ctb]",
"Santander Meteorology Group <http://meteo.unican.es> [ctb]",
"Maria Dolores Frias <[email protected]> [aut, cre]",
"Jesus Fernandez <[email protected]> [aut]",
"Maialen Iturbide <[email protected]> [aut]",
"Joaquin Bedia <[email protected]> [aut]",
"Max Tuni <[email protected]> [ctb]",
"Sixto Herrera <[email protected]> [ctb]",
"Rodrigo Manzanas <[email protected]> [ctb]",
"Antonio Cofino <[email protected]> [ctb]",
"Maialen Iturbide <[email protected]> [ctb]",
"Jose Manuel Gutierrez <[email protected]> [ctb]",
"Andrea Taylor <[email protected]> [ctb]",
"Aidan Slingsby <[email protected]> [ctb]",
"Santander Meteorology Group <http://meteo.unican.es> [aut]"))
"Aidan Slingsby <[email protected]> [ctb]"))
BugReports: https://github.com/SantanderMetGroup/visualizeR/issues
URL: https://github.com/SantanderMetGroup/visualizeR/wiki
Description: Implementation of various seasonal forecast verification plots.
Description: Implementation of seasonal climate verification plots.
License: file LICENSE
LazyData: true
RoxygenNote: 5.0.1
RoxygenNote: 6.0.1
10 changes: 4 additions & 6 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
visualizeR
==========
visualizeR 0.2.1
=================

* Added optional argument 'forecast' in all the visualizations (except reliabilityCategories) to show results for the forecast event (not just for the hindcast).
* Several improvements in the appearance of the visualizations.
* Enhanced reliability diagrams, importing funcitonalities from lattice
* Other minor changes and enhancements.
* Minor bug in reliabilityCategories and spreadPlot.
* Other minor changes and documentation updates.
42 changes: 36 additions & 6 deletions R/bubblePlot.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## bubblePlot Bubble plot for visualization of forecast skill of ensemble predictions.
## bubblePlot Bubble plot for visualization of forecast skill of seasonal climate predictions.
##
## Copyright (C) 2016 Santander Meteorology Group (http://www.meteo.unican.es)
##
Expand All @@ -15,9 +15,9 @@
## You should have received a copy of the GNU General Public License
## along with this program. If not, see <http://www.gnu.org/licenses/>.

#' @title Bubble plot for visualization of forecast skill of ensemble predictions.
#' @title Bubble plot for visualization of forecast skill of seasonal climate predictions.
#'
#' @description Bubble plot for visualization of forecast skill of ensemble predictions. It provides a
#' @description Bubble plot for visualization of forecast skill of seasonal climate predictions. It provides a
#' spatially-explicit representation of the skill, resolution and reliability of a probabilistic predictive
#' system in a single map.
#' This function is prepared to plot the data sets loaded from the ECOMS User Data Gateway (ECOMS-UDG). See
Expand Down Expand Up @@ -77,16 +77,42 @@
#'
#' @note The computation of climatological terciles requires a representative period to obtain meaningful results.
#'
#' @examples \dontrun{
#' data(tas.cfs)
#' data(tas.cfs.operative.2016)
#' data(tas.ncep)
#' require(transformeR)
#' # Select spatial domain
#' tas.ncep2 <- subsetGrid(tas.ncep, lonLim = c(-80, -35), latLim = c(-12, 12))
#' tas.cfs2 <- subsetGrid(tas.cfs, lonLim = c(-80, -35), latLim = c(-12, 12))
#' tas.cfs.operative2.2016 <- subsetGrid(tas.cfs.operative.2016,
#' lonLim = c(-80, -35), latLim = c(-12, 12))
#' # Interpolate
#' tas.ncep2.int <- interpGrid(tas.ncep2, getGrid(tas.cfs2))
#' # Bubble plot. Only colour of the bubble is plotted indicating the most likely tercile
#' bubblePlot(hindcast = tas.cfs2, obs = tas.ncep2.int, forecast = tas.cfs.operative2.2016,
#' bubble.size = 1.5, size.as.probability = FALSE, score = FALSE)
#' # Bubble plot. Added size of the bubble indicating the probability of the most likely tercile
#' bubblePlot(hindcast = tas.cfs2, obs = tas.ncep2.int, forecast = tas.cfs.operative2.2016,
#' bubble.size = 1.5, score = FALSE)
#' # Bubble plot. Added transparency of the bubble indicating the ROC skill score (ROCSS)
#' bubblePlot(hindcast = tas.cfs2, obs = tas.ncep2.int, forecast = tas.cfs.operative2.2016,
#' bubble.size = 1.5)
#' # 3-piece pie chart.
#' bubblePlot(hindcast = tas.cfs2, obs = tas.ncep2.int, forecast = tas.cfs.operative2.2016,
#' bubble.size = 1, piechart = TRUE)
#' }
#'
#' @author M.D. Frias \email{mariadolores.frias@@unican.es} and J. Fernandez based on the original diagram
#' conceived by Slingsby et al 2009.
#' conceived by Slingsby et al (2009).
#'
#' @family VisualizeR
#'
#' @references
#' Jolliffe, I. T. and Stephenson, D. B. 2003. Forecast Verification: A Practitioner's Guide in Atmospheric
#' Science, Wiley, NY.
#'
#' Slingsby A., Lowe R., Dykes J., Stephenson D. B., Wood J., Jupp T. E. 2009. A pilot study for the collaborative
#' Slingsby A., Lowe R., Dykes J., Stephenson D. B., Wood J. and Jupp T. E. 2009. A pilot study for the collaborative
#' development of new ways of visualising seasonal climate forecasts. Proc. 17th Annu. Conf. of GIS Research UK,
#' Durham, UK, 1-3 April 2009.

Expand Down Expand Up @@ -370,7 +396,11 @@ bubblePlot <- function(hindcast, obs, forecast=NULL, year.target=NULL, detrend=F
} else{
legtext <- c("Below", "Normal", "Above")
}
legend('bottomleft', legend=legtext, pch=c(19, 19, 19), col=c(t.colors), cex=0.7, horiz=T, bty="n", xjust=0)
xcoords <- c(0, 0.55, 0.95)
secondvector <- (1:length(legtext))-1
textwidths <- xcoords/secondvector
textwidths[1] <- 0
legend('bottomleft', legend=legtext, pch=c(19, 19, 19), col=c(t.colors), cex=0.7, horiz=T, bty="n", text.width=textwidths, xjust=0)
}
}
par(opar)
Expand Down
Loading

0 comments on commit 0e35e86

Please sign in to comment.