Skip to content

Commit

Permalink
Update map.lines example with real data
Browse files Browse the repository at this point in the history
  • Loading branch information
jbedia committed May 12, 2017
1 parent 892c79e commit ed0792e
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 88 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Suggests:
visualizeR
Type: Package
Title: Climate data manipulation and transformation
Version: 0.0-13
Version: 0.0.13
Date: 2017-05-12
Authors@R: as.person(c(
"Santander Meteorology Group <http://meteo.unican.es> [ctb]",
Expand Down
54 changes: 10 additions & 44 deletions R/plotClimatology.R
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,8 @@ clim2sgdf <- function(clim, set.min, set.max) {
#' @param condition Inequality operator to be applied considering the given \code{threshold}.
#' \code{"GT"} = greater than the value of \code{threshold}, \code{"GE"} = greater or equal,
#' \code{"LT"} = lower than, \code{"LE"} = lower or equal than. Default to \code{"LT"} (see the rationale in the next argument).
#' @param threshold Threshold below which stippling points are drawn. Default to \code{0.05},
#' in combination with \code{condition = "LT"} as tipically used for stippling statistically significant
#' @param threshold Reference threshold value to specify stippling points. Default to \code{0.05},
#' in combination with \code{condition = "LT"}, as tipically used for stippling statistically significant
#' values (p-values).
#' @param ... Further optional style arguments (see the examples).
#' @return A list with a \code{SpatialPoints} object,
Expand Down Expand Up @@ -355,51 +355,17 @@ map.stippling <- function(clim, threshold = 0.05, condition = "LT", ...) {
#'
#' # Adding a line (real data of a storm-track imported from a csv file)
#' # Source: http://www.europeanwindstorms.org/
#' custom.coords <- matrix(data = c(5.107992e+00, 50.918724,
#' 5.196424e+00, 50.424644,
#' 6.717298e+00, 50.669502,
#' 7.581101e+00, 51.268070,
#' 8.337102e+00, 52.482281,
#' 8.654995e+00, 53.897640,
#' 9.160504e+00, 55.638844,
#' 9.484845e+00, 56.996574,
#' 9.622513e+00, 58.232494,
#' 9.601024e+00, 59.553925,
#' 9.398860e+00, 60.328747,
#' 9.033046e+00, 61.352264,
#' 8.315894e+00, 62.177078,
#' 8.189283e+00, 63.109001,
#' 7.583086e+00, 63.994907,
#' 7.470014e+00, 64.906883,
#' 6.852325e+00, 65.618355,
#' 7.491460e+00, 66.142708,
#' 7.182003e+00, 66.760963,
#' 7.259294e+00, 67.072113,
#' 6.798459e+00, 67.460014,
#' 7.391743e+00, 67.698784,
#' 6.541360e+00, 67.786652,
#' 6.700550e+00, 68.082726,
#' 5.629124e+00, 67.311905,
#' 6.236451e+00, 67.361435,
#' 5.264146e+00, 65.211510,
#' 5.288309e+00, 64.971802,
#' 4.793668e+00, 64.500343,
#' 5.259259e+00, 64.580620,
#' 4.868121e+00, 64.275414,
#' 4.682920e+00, 64.282272,
#' 4.596509e+00, 63.880211,
#' 4.055306e+00, 63.945942,
#' 3.823502e+00, 62.735146,
#' 3.535903e+00, 61.991531,
#' 3.012845e+00, 62.029030),
#' ncol = 2, byrow = TRUE)
#' \dontrun{
#' dat <- url("http://www.europeanwindstorms.org/repository/Jeanette/Jeanette_track.csv")
#' custom.coords <- read.csv(dat, header = FALSE)[ ,5:4]
#' storm <- map.lines(coords = custom.coords,
#' lwd = 3,
#' col = "red")
#' plotClimatology(climatology(tasmax_forecast, by.member = FALSE), backdrop.theme = "coastline",
#' sp.layout = list(storm), # Add storm track
#' scales = list(draw = TRUE)) # Add coordinate axes

#' plotClimatology(climatology(tasmax_forecast, by.member = FALSE), backdrop.theme = "coastline",
#' sp.layout = list(storm), # Add storm track
#' scales = list(draw = TRUE)) # Add coordinate axes
#' }
#'

map.lines <- function(lonLim = NULL, latLim = NULL, coords = NULL, ...) {
if (is.null(lonLim) && is.null(latLim) && is.null(coords)) stop("Undefined polygon coordinates")
Expand Down
49 changes: 8 additions & 41 deletions man/map.lines.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/map.stippling.Rd

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

0 comments on commit ed0792e

Please sign in to comment.