Skip to content

Commit

Permalink
Doc update
Browse files Browse the repository at this point in the history
  • Loading branch information
jbedia committed May 23, 2020
1 parent f29e3a8 commit 4352395
Show file tree
Hide file tree
Showing 32 changed files with 86 additions and 45 deletions.
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@ Imports:
grDevices,
data.table
Suggests:
climate4R.datasets,
loadeR.ECOMS,
loadeR,
knitr
Type: Package
Title: Visualizing climate4R data and Communicating Uncertainty in Seasonal Climate Prediction
Version: 1.6.0
Date: 2020-05-22
Date: 2020-05-23
Author: as.person(c(
"Santander Meteorology Group <http://meteo.unican.es> [cph]",
"María Dolores Frías <[email protected]> [aut, cre]",
Expand Down
2 changes: 1 addition & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export(cascadePlot)
export(climagram)
export(densityPlot)
export(detrend.data)
export(draw.world.lines)
export(map.hatching)
export(map.lines)
export(map.stippling)
Expand Down Expand Up @@ -107,7 +108,6 @@ importFrom(transformeR,checkTemporalConsistency)
importFrom(transformeR,clim2sgdf)
importFrom(transformeR,climatology)
importFrom(transformeR,detrendGrid)
importFrom(transformeR,draw.world.lines)
importFrom(transformeR,getCoordinates)
importFrom(transformeR,getDim)
importFrom(transformeR,getGrid)
Expand Down
4 changes: 2 additions & 2 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
* Add boxplot option in violinPlot
* Other minor doc updates

## v1.6.0 (22 May 2020)
* Add plotEOF (deprecated), formerly in transformeR
## v1.6.0 (23 May 2020)
* Add plotEOF (deprecated) and draw.world.lines utility, formerly in transformeR
* Load example datasets from the new climate4R.datasets package
* Other documentation and example updates
4 changes: 2 additions & 2 deletions R/bubblePlot.R
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
#'
#' @importFrom scales alpha
#' @importFrom mapplots draw.pie add.pie
#' @importFrom transformeR array3Dto2Dmat mat2Dto3Darray draw.world.lines interpGrid subsetGrid
#' @importFrom transformeR array3Dto2Dmat mat2Dto3Darray interpGrid subsetGrid
#' @importFrom abind abind
#' @importFrom grDevices gray
#' @importFrom graphics par plot mtext points legend
Expand Down Expand Up @@ -359,7 +359,7 @@ bubblePlot <- function(hindcast, obs, forecast=NULL, year.target=NULL, detrend=F
}
}
# Add borders
draw.world.lines(lwd=1)
draw.world.lines(lwd = 1)
#world(add = TRUE, interior = T)
#world(add = TRUE, interior = F, lwd=3)
par(fig = c(0, 1, 0, 1), oma = c(0, 0, 0, 0), mar = c(0, 0, 0, 0), new = TRUE)
Expand Down
24 changes: 12 additions & 12 deletions R/rdas.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
#' @name tas.ncep
#' @examples
#' data(tas.ncep)
#' require(transformeR)
#' plotClimatology(climatology(tas.ncep), backdrop.theme = "coastline")
#' spatialPlot(climatology(tas.ncep), backdrop.theme = "coastline", rev.colors = TRUE)
NULL


Expand All @@ -20,8 +19,7 @@ NULL
#' @references Saha, S. et al. 2014. The NCEP Climate Forecast System Version 2. J Clim 130925135638001. doi:10.1175/JCLI-D-12-00823.1
#' @examples \dontrun{
#' data(tas.cfs)
#' require(transformeR)
#' plotClimatology(climatology(tas.cfs), backdrop.theme = "coastline")
#' spatialPlot(climatology(tas.cfs), backdrop.theme = "coastline", rev.colors = TRUE)
#' }
NULL

Expand All @@ -37,8 +35,7 @@ NULL
#' @references Saha, S. et al. 2014. The NCEP Climate Forecast System Version 2. J Clim 130925135638001. doi:10.1175/JCLI-D-12-00823.1
#' @examples \dontrun{
#' data(tas.cfs.operative.2016)
#' require(transformeR)
#' plotClimatology(climatology(tas.cfs.operative.2016, parallel = TRUE), backdrop.theme = "coastline")
#' spatialPlot(climatology(tas.cfs.operative.2016, parallel = TRUE), backdrop.theme = "coastline", rev.colors = TRUE)
#' }
NULL

Expand All @@ -53,8 +50,7 @@ NULL
#' @references Saha, S. et al. 2014. The NCEP Climate Forecast System Version 2. J Clim 130925135638001. doi:10.1175/JCLI-D-12-00823.1
#' @examples \dontrun{
#' data(tas.cfs.operative.2017)
#' require(transformeR)
#' plotClimatology(climatology(tas.cfs.operative.2017, parallel = TRUE), backdrop.theme = "coastline")
#' spatialPlot(climatology(tas.cfs.operative.2017, parallel = TRUE), backdrop.theme = "coastline", rev.colors = TRUE)
#' }
NULL

Expand All @@ -66,8 +62,10 @@ NULL
#' @name AR5regions
#' @examples \dontrun{
#' data(AR5regions)
#' require(sp)
#' require(transformeR)
#' sp::plot(AR5regions, border = "red", axes = TRUE)
#' transformeR:::draw.world.lines()
#' draw.world.lines()
#' title("AR5 World regions")
#' }
NULL
Expand All @@ -79,8 +77,10 @@ NULL
#' @name PRUDENCEregions
#' @examples \dontrun{
#' data(PRUDENCEregions)
#' require(sp)
#' require(transformeR)
#' sp::plot(PRUDENCEregions, border = "red", axes = TRUE)
#' transformeR:::draw.world.lines()
#' draw.world.lines()
#' title("PRUDENCE European regions")
#' }
NULL
Expand All @@ -106,12 +106,12 @@ NULL
#'
#' # All regions
#' sp::plot(AR6_WGI_AtlasSynthesisRegions, border = "red", axes = TRUE)
#' transformeR:::draw.world.lines()
#' draw.world.lines()
#' title("AR6 World land regions")
#'
#' # A single region (use region names for subsetting)
#' sp::plot(AR6_WGI_AtlasSynthesisRegions["Africa"], border = "red", axes = TRUE)
#' transformeR:::draw.world.lines()
#' draw.world.lines()
#' title("AR6 Mediterranean region")
#' }
NULL
7 changes: 4 additions & 3 deletions R/reliabilityCategories.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
#' are reescaled according to parameter \code{cex.scale}.
#' @param cex.scale numeric (default is 20). Scaling factor for points sizes in the reliability diagrams (see parameter \code{cex0})
#' @param layout integer (default = c(1, n.events)). Sets the layout of panels (rows,cols)
#' @param backdrop.theme Reference geographical lines to be added to the plot. Default is "countries"
#' (See \code{\link[transformeR]{plotClimatology}} for options).
#' @param backdrop.theme Reference geographical lines to be added to the plot. Default is \code{"countries"}
#' (See \code{\link{spatialPlot}} for other options).
#' @param return.diagrams Logical. Available when \code{diagrams = TRUE}. If TRUE a trellis object for plotting diagrams is returned.
# @param nod Required if diagrams = TRUE. m*2 matrix of coordinates (m=locations, column1=latitude, column2=longitude)
# @param xlim Required if diagrams = TRUE. Limits for maps
Expand Down Expand Up @@ -97,7 +97,8 @@
#' rel <- reliabilityCategories(hindcast = tas.cfs2.int, obs = tas.ncep2,
#' n.bins = 5, n.boot = 10)
#' # Irregular grids
#' data("VALUE_Iberia_tas")
#' require(climate4R.datasets)
#' data("NCEP_Iberia_tas")
#' data("CFS_Iberia_tas")
#' obs <- aggregateGrid(VALUE_Iberia_tas, aggr.y = list(FUN= mean))
#' hind <- aggregateGrid(interpGrid(NCEP_Iberia_tas, getGrid(obs)), aggr.y = list(FUN= mean))
Expand Down
15 changes: 11 additions & 4 deletions R/spatialPlot.R
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,9 @@
#' \code{\link{map.stippling}}, for adding a custom point layer on top of the map.
#' \code{\link{map.lines}}, to add lines and polygons to climatological maps
#' Also see \code{\link[sp]{spplot}} in package \pkg{sp} for further information on plotting capabilities and options
#' @examples
#' @examples \donttest{
#' require(transformeR)
#' require(climate4R.datasets)
#' data("CFS_Iberia_tas")
#' # Climatology is computed:
#' clim <- climatology(CFS_Iberia_tas, by.member = TRUE)
Expand Down Expand Up @@ -169,6 +170,7 @@
#' backdrop.theme = "countries",
#' color.theme = "BrBG",
#' rev.colors = TRUE, cex = 2.5)
#' }


spatialPlot <- function(grid,
Expand Down Expand Up @@ -258,7 +260,9 @@ spatialPlot <- function(grid,
#' @seealso \code{\link{spatialPlot}}, to which its output is passed.
#' \code{\link{map.lines}}, for further map customizations.
#' @author J. Bedia
#' @examples
#' @examples \donttest{
#' require(climate4R.datasets)
#' require(transformeR)
#' data("CFS_Iberia_tas")
#' p90clim <- climatology(CFS_Iberia_tas,
#' by.member = FALSE,
Expand Down Expand Up @@ -289,6 +293,7 @@ spatialPlot <- function(grid,
#' spatialPlot(climatology(CFS_Iberia_tas),
#' backdrop.theme = "coastline",
#' sp.layout = list(pts))
#' }


map.stippling <- function(clim, threshold = 0.05, condition = "LT", ...) {
Expand Down Expand Up @@ -336,7 +341,9 @@ map.stippling <- function(clim, threshold = 0.05, condition = "LT", ...) {
#' @export
#' @seealso \code{\link{spatialPlot}}, to which its output is passed.
#' \code{\link{map.stippling}}, for further map customizations.
#' @examples
#' @examples \donttest{
#' require(climate4R.datasets)
#' require(transformeR)
#' data("CFS_Iberia_tas")
#' # Define a rectangular window centered on the Iberian Peninsula
#' iberia <- map.lines(lonLim = c(-10,3.5), latLim = c(36,43))
Expand All @@ -358,7 +365,7 @@ map.stippling <- function(clim, threshold = 0.05, condition = "LT", ...) {
#' spatialPlot(climatology(CFS_Iberia_tas, by.member = FALSE), backdrop.theme = "coastline",
#' sp.layout = list(iberia, alps))
#'
#' \dontrun{
#'
#' # Adding a line (real data of a storm-track imported from a csv file)
#' # Source: http://www.europeanwindstorms.org/
#'
Expand Down
6 changes: 5 additions & 1 deletion R/temporalPlot.R
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,12 @@
#'@importFrom data.table rleid
#'@importFrom transformeR gridDepth
#'@import latticeExtra
#' @examples
#' @examples \donttest{
#' require(climate4R.datasets)
#' require(transformeR)
#' data("CFS_Iberia_pr")
#' data("EOBS_Iberia_pr")
#' data("EOBS_Iberia_tas")
#' data("VALUE_Iberia_pr")
#' # Combine grids with members (CFS) and without members (EOBS)
#' a <- subsetGrid(CFS_Iberia_tas, years = 1985:1992)
Expand All @@ -94,6 +97,7 @@
#' temporalPlot("EOBS" = b1, "CFS" = a1,
#' cols = c("green", "deeppink"), show.na = TRUE,
#' xyplot.custom = list(main = "winter temperature", ylab = "Celsius"))
#' }


temporalPlot <- function(...,
Expand Down
5 changes: 4 additions & 1 deletion R/tercileMap.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,14 @@
#'@export
#'@importFrom grDevices colorRampPalette
#'@importFrom transformeR aggregateGrid subsetGrid getShape redim climatology bindGrid
#' @examples
#' @examples \donttest{
#' require(climate4R.datasets)
#' data(CFS_Iberia_tas)
#' library(transformeR)
#' hindcast <- subsetGrid(CFS_Iberia_tas, years = 1983:2001)
#' forecast <- subsetGrid(CFS_Iberia_tas, years = 2002)
#' tercileMap(hindcast, forecast)
#' }

tercileMap <- function(hindcast, forecast, ...) {
custom <- list(...)
Expand Down
4 changes: 3 additions & 1 deletion R/violinPlot.R
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@
#' @importFrom transformeR gridDepth
#' @importFrom stats sd
#' @import latticeExtra
#' @examples
#' @examples \donttest{
#' require(climate4R.datasets)
#' data("EOBS_Iberia_tas")
#' data("EOBS_Iberia_pr")
#' data("CORDEX_Iberia_pr")
Expand Down Expand Up @@ -122,6 +123,7 @@
#' as.table = TRUE,
#' do.out = FALSE))
#' a + b
#' }


violinPlot <- function(...,
Expand Down
Binary file modified data/AR5regions.rda
Binary file not shown.
Binary file modified data/PRUDENCEregions.rda
Binary file not shown.
Binary file modified data/regions.rda
Binary file not shown.
Binary file modified data/tas.cfs.operative.2016.rda
Binary file not shown.
Binary file modified data/tas.cfs.operative.2017.rda
Binary file not shown.
Binary file modified data/tas.cfs.rda
Binary file not shown.
Binary file modified data/tas.ncep.rda
Binary file not shown.
4 changes: 3 additions & 1 deletion man/AR5regions.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/AR6_WGI_AtlasSynthesisRegions.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion man/PRUDENCEregions.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion man/map.lines.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions man/map.stippling.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/plotEOF.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions man/reliabilityCategories.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions man/spatialPlot.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 4352395

Please sign in to comment.