From 36bed4e6abc2e8ba0c6d1cbe43f91e75027690bd Mon Sep 17 00:00:00 2001 From: aho Date: Thu, 3 Jun 2021 17:53:54 +0200 Subject: [PATCH 1/6] Modify the criteria of regrid when one data and the grids need to shift. --- R/Utils.R | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/R/Utils.R b/R/Utils.R index 9dfcaa73..afe075cb 100644 --- a/R/Utils.R +++ b/R/Utils.R @@ -322,11 +322,9 @@ if ((grid_lons != common_grid_lons) || (grid_lats != common_grid_lats) || (grid_type != common_grid_type) || - ((lon[1] != first_common_grid_lon) - && !work_piece[['single_dataset']])) { + (lon[1] != first_common_grid_lon)) { if (grid_lons == common_grid_lons && grid_lats == common_grid_lats && - grid_type == common_grid_type && lon[1] != first_common_grid_lon && - !work_piece[['single_dataset']]) { + grid_type == common_grid_type && lon[1] != first_common_grid_lon) { remove_shift <- TRUE } remap_needed <- TRUE -- GitLab From 42273bcb1033aa76590cb38a6ad983ad2820ec74 Mon Sep 17 00:00:00 2001 From: aho Date: Thu, 3 Jun 2021 20:03:51 +0200 Subject: [PATCH 2/6] Add contour and arrow features --- R/PlotStereoMap.R | 360 +++++++++++++++++++++++++++++++++++++++---- man/PlotStereoMap.Rd | 134 ++++++++++++++-- 2 files changed, 451 insertions(+), 43 deletions(-) diff --git a/R/PlotStereoMap.R b/R/PlotStereoMap.R index 5572f89a..219956cd 100644 --- a/R/PlotStereoMap.R +++ b/R/PlotStereoMap.R @@ -4,8 +4,8 @@ #'a polar stereographic world projection with coloured grid cells. Only the #'region within a specified latitude interval is displayed. A colour bar #'(legend) can be plotted and adjusted. It is possible to draw superimposed -#'dots, symbols and boxes. A number of options is provided to adjust the -#'position, size and colour of the components. This plot function is +#'dots, symbols, boxes, contours, and arrows. A number of options is provided to +#'adjust the position, size and colour of the components. This plot function is #'compatible with figure layouts if colour bar is disabled. #' #'@param var Array with the values at each cell of a grid on a regular @@ -24,6 +24,10 @@ #'@param lat Numeric vector of latitude locations of the cell centers of the #' grid of 'var', in any order (same as 'var'). Expected to be from a regular #' rectangular or gaussian grid, within the range [-90, 90]. +#'@param varu Array of the zonal component of wind/current/other field with +#' the same dimensions as 'var'. +#'@param varv Array of the meridional component of wind/current/other field +#' with the same dimensions as 'var'. #'@param latlims Latitudinal limits of the figure.\cr #' Example : c(60, 90) for the North Pole\cr #' c(-90,-60) for the South Pole @@ -58,6 +62,24 @@ #' continents. Takes the value gray(0.5) by default. #'@param coast_width Line width of the coast line of the drawn projected #' continents. Takes the value 1 by default. +#'@param contours Array of same dimensions as 'var' to be added to the plot +#' and displayed with contours. Parameter 'brks2' is required to define the +#' magnitude breaks for each contour curve. +#'@param brks2 A numeric value or vector of magnitude breaks where to draw +#' contour curves for the array provided in 'contours'. If it is a number, it +#' represents the number of breaks (n) that defines (n - 1) intervals to +#' classify 'contours'. +#'@param contour_lwd Line width of the contour curves provided via 'contours' +#' and 'brks2'. The default value is 0.5. +#'@param contour_color Line color of the contour curves provided via 'contours' +#' and 'brks2'. +#'@param contour_lty Line type of the contour curves. Takes 1 (solid) by +#' default. See help on 'lty' in par() for other accepted values. +#'@param contour_label_draw A logical value indicating whether to draw the +#' contour labels (TRUE) or not (FALSE) when 'contours' is used. The default +#' value is TRUE. +#'@param contour_label_scale Scale factor for the superimposed labels when +#' drawing contour levels. The default value is 0.6. #'@param dots Array of same dimensions as 'var' or with dimensions #' c(n, dim(var)), where n is the number of dot/symbol layers to add to the #' plot. A value of TRUE at a grid cell will draw a dot/symbol on the @@ -74,6 +96,23 @@ #' layers in 'dots'. Takes 1 by default. #'@param intlat Interval between latitude lines (circles), in degrees. #' Defaults to 10. +#'@param arr_subsamp A number as subsampling factor to select a subset of arrows +#' in 'varu' and 'varv' to be drawn. Only one out of arr_subsamp arrows will +#' be drawn. The default value is 1. +#'@param arr_scale A number as scale factor for drawn arrows from 'varu' and +#' 'varv'. The default value is 1. +#'@param arr_ref_len A number of the length of the refence arrow to be drawn as +#' legend at the bottom of the figure (in same units as 'varu' and 'varv', only +#' affects the legend for the wind or variable in these arrays). The default +#' value is 15. +#'@param arr_units Units of 'varu' and 'varv', to be drawn in the legend. +#' Takes 'm/s' by default. +#'@param arr_scale_shaft A number for the scale of the shaft of the arrows +#' (which also depend on the number of figures and the arr_scale parameter). +#' The default value is 1. +#'@param arr_scale_shaft_angle A number for the scale of the angle of the +#' shaft of the arrows (which also depend on the number of figure and the +#' arr_scale parameter). The default value is 1. #'@param drawleg Whether to plot a color bar (legend, key) or not. #' Defaults to TRUE. #'@param boxlim Limits of a box to be added to the plot, in degrees: @@ -144,15 +183,21 @@ #'@importFrom grDevices dev.cur dev.new dev.off gray #'@importFrom stats median #'@export -PlotStereoMap <- function(var, lon, lat, latlims = c(60, 90), +PlotStereoMap <- function(var, lon, lat, varu = NULL, varv = NULL, latlims = c(60, 90), toptitle = NULL, sizetit = NULL, units = NULL, brks = NULL, cols = NULL, bar_limits = NULL, triangle_ends = NULL, col_inf = NULL, col_sup = NULL, colNA = NULL, color_fun = clim.palette(), filled.continents = FALSE, coast_color = NULL, coast_width = 1, + contours = NULL, brks2 = NULL, contour_lwd = 0.5, + contour_color = 'black', contour_lty = 1, + contour_label_draw = TRUE, contour_label_scale = 0.6, dots = NULL, dot_symbol = 4, dot_size = 0.8, intlat = 10, + arr_subsamp = floor(length(lon) / 30), arr_scale = 1, + arr_ref_len = 15, arr_units = "m/s", + arr_scale_shaft = 1, arr_scale_shaft_angle = 1, drawleg = TRUE, subsampleg = NULL, bar_extra_labels = NULL, draw_bar_ticks = TRUE, draw_separators = FALSE, triangle_ends_scale = 1, @@ -204,17 +249,40 @@ PlotStereoMap <- function(var, lon, lat, latlims = c(60, 90), stop("Parameter 'var' must be a numeric array with two dimensions.") } dims <- dim(var) + + # Check varu and varv + if (!is.null(varu) && !is.null(varv)) { + if (!is.array(varu) || !(length(dim(varu)) == 2)) { + stop("Parameter 'varu' must be a numerical array with two dimensions.") + } + if (!is.array(varv) || !(length(dim(varv)) == 2)) { + stop("Parameter 'varv' must be a numerical array with two dimensions.") + } + } else if (!is.null(varu) || !is.null(varv)) { + stop("Only one of the components 'varu' or 'varv' has been provided. Both must be provided.") + } + + if (!is.null(varu) && !is.null(varv)) { + if (dim(varu)[1] != dims[1] || dim(varu)[2] != dims[2]) { + stop("Parameter 'varu' must have same number of longitudes and latitudes as 'var'.") + } + if (dim(varv)[1] != dims[1] || dim(varv)[2] != dims[2]) { + stop("Parameter 'varv' must have same number of longitudes and latitudes as 'var'.") + } + } + # Transpose the input matrices because the base plot functions work directly # with dimensions c(lon, lat). if (dims[1] != length(lon) || dims[2] != length(lat)) { if (dims[1] == length(lat) && dims[2] == length(lon)) { var <- t(var) + if (!is.null(varu)) varu <- t(varu) + if (!is.null(varv)) varv <- t(varv) if (!is.null(dots)) dots <- aperm(dots, c(1, 3, 2)) dims <- dim(var) } } - # Check lon if (length(lon) != dims[1]) { stop("Parameter 'lon' must have as many elements as the number of cells along longitudes in the input array 'var'.") @@ -225,6 +293,14 @@ PlotStereoMap <- function(var, lon, lat, latlims = c(60, 90), stop("Parameter 'lat' must have as many elements as the number of cells along longitudes in the input array 'var'.") } + # Prepare sorted lon/lat and other arguments + latb <- sort(lat, index.return = TRUE) + lonb <- sort(lon, index.return = TRUE) + latmin <- floor(min(lat) / 10) * 10 + latmax <- ceiling(max(lat) / 10) * 10 + lonmin <- floor(min(lon) / 10) * 10 + lonmax <- ceiling(max(lon) / 10) * 10 + # Check latlims if (!is.numeric(latlims) || length(latlims) != 2) { stop("Parameter 'latlims' must be a numeric vector with two elements.") @@ -234,12 +310,16 @@ PlotStereoMap <- function(var, lon, lat, latlims = c(60, 90), if (max(abs(latlims - center_at)) > 90 + 20) { stop("The range specified in 'latlims' is too wide. 110 degrees supported maximum.") } - dlon <- median(lon[2:dims[1]] - lon[1:(dims[1] - 1)]) / 2 - dlat <- median(lat[2:dims[2]] - lat[1:(dims[2] - 1)]) / 2 + dlon <- median(lonb$x[2:dims[1]] - lonb$x[1:(dims[1] - 1)]) / 2 + dlat <- median(latb$x[2:dims[2]] - latb$x[1:(dims[2] - 1)]) / 2 original_last_lat <- latlims[which.min(abs(latlims))] - last_lat <- lat[which.min(abs(lat - original_last_lat))] - dlat * sign(center_at) + last_lat <- latb$x[which.min(abs(latb$x - original_last_lat))] - dlat * sign(center_at) latlims[which.min(abs(latlims))] <- last_lat + # Subset lat by latlims + lat_plot_ind <- which(lat >= latlims[1] & lat <= latlims[2]) + latb_plot_ind <- which(latb$x >= latlims[1] & latb$x <= latlims[2]) + # Check toptitle if (is.null(toptitle) || is.na(toptitle)) { toptitle <- '' @@ -316,6 +396,69 @@ PlotStereoMap <- function(var, lon, lat, latlims = c(60, 90), if (!is.numeric(coast_width)) { stop("Parameter 'coast_width' must be numeric.") } + # Check contours + if (!is.null(contours)) { + if (!is.array(contours)) { + stop("Parameter 'contours' must be a numeric array.") + } + if (length(dim(contours)) > 2) { + contours <- drop(contours) + dim(contours) <- head(c(dim(contours), 1, 1), 2) + } + if (length(dim(contours)) > 2) { + stop("Parameter 'contours' must be a numeric array with two dimensions.") + } else if (length(dim(contours)) < 2) { + stop("Parameter 'contours' must be a numeric array with two dimensions.") + } + # Transpose the input matrices because the base plot functions work directly + # with dimensions c(lon, lat). + if (dim(contours)[1] == dims[2] & dim(contours)[2] == dims[1]) { + contours <- t(contours) + } else { + stop("Parameter 'contours' must have the same number of longitudes and latitudes as 'var'.") + } + } + + # Check brks2 + if (!is.null(contours)) { + if (is.null(brks2)) { + ll <- signif(min(contours, na.rm = TRUE), 2) + ul <- signif(max(contours, na.rm = TRUE), 2) + brks2 <- unique(signif(seq(ll, ul, length.out = length(brks)), 2)) + + } else if (is.numeric(brks2) & length(brks2) == 1) { + ll <- signif(min(contours, na.rm = TRUE), 2) + ul <- signif(max(contours, na.rm = TRUE), 2) + brks2 <- unique(signif(seq(ll, ul, length.out = brks2), 2)) + } else if (!is.numeric(brks2)) { + stop("Parameter 'brks2' must be a numeric value or vector.") + } + } + + # Check contour_lwd + if (!is.numeric(contour_lwd)) { + stop("Parameter 'contour_lwd' must be numeric.") + } + + # Check contour_color + if (!.IsColor(contour_color)) { + stop("Parameter 'contour_color' must be a valid colour identifier.") + } + + # Check contour_lty + if (!is.numeric(contour_lty) && !is.character(contour_lty)) { + stop("Parameter 'contour_lty' must be either a number or a character string.") + } + + # Check contour_label_draw + if (!is.logical(contour_label_draw)) { + stop("Parameter 'contour_label_draw' must be a logical value.") + } + + # Check contour_label_scale + if (!is.numeric(contour_label_scale)) { + stop("Parameter 'contour_label_scale' must be numeric.") + } # Check dots, dot_symbol and dot_size if (!is.null(dots)) { @@ -345,6 +488,26 @@ PlotStereoMap <- function(var, lon, lat, latlims = c(60, 90), stop("Parameter 'intlat' must be numeric.") } + # Check arrow parameters + if (!is.numeric(arr_subsamp)) { + stop("Parameter 'arr_subsamp' must be numeric.") + } + if (!is.numeric(arr_scale)) { + stop("Parameter 'arr_scale' must be numeric.") + } + if (!is.numeric(arr_ref_len)) { + stop("Parameter 'arr_ref_len' must be numeric.") + } + if (!is.character(arr_units)) { + stop("Parameter 'arr_units' must be character.") + } + if (!is.numeric(arr_scale_shaft)) { + stop("Parameter 'arr_scale_shaft' must be numeric.") + } + if (!is.numeric(arr_scale_shaft_angle)) { + stop("Parameter 'arr_scale_shaft_angle' must be numeric.") + } + # Check legend parameters if (!is.logical(drawleg)) { stop("Parameter 'drawleg' must be logical.") @@ -404,6 +567,9 @@ PlotStereoMap <- function(var, lon, lat, latlims = c(60, 90), title_scale <- title_scale * scale margin_scale <- margin_scale * scale dot_size <- dot_size * scale + arr_scale <- arr_scale * scale + contour_label_scale <- contour_label_scale * scale + contour_lwd <- contour_lwd * scale } } @@ -434,6 +600,10 @@ PlotStereoMap <- function(var, lon, lat, latlims = c(60, 90), bar_extra_margin[1] <- bar_extra_margin[1] + margins[1] bar_extra_margin[3] <- bar_extra_margin[3] + margins[3] + if (!is.null(varu)) { + margins[1] <- margins[1] + 2.2 * units_scale + } + if (drawleg) { layout(matrix(1:2, ncol = 2, nrow = 1), widths = c(8, 2)) } @@ -468,35 +638,93 @@ PlotStereoMap <- function(var, lon, lat, latlims = c(60, 90), col_inf_image <- ifelse(is.null(col_inf), colNA, col_inf) col_sup_image <- ifelse(is.null(col_sup), colNA, col_sup) # Draw the data polygons - for (jx in 1:dims[1]) { - for (jy in 1:dims[2]) { - if (lat[jy] >= latlims[1] && latlims[2] >= lat[jy]) { - coord <- mapproj::mapproject(c(lon[jx] - dlon, lon[jx] + dlon, - lon[jx] + dlon, lon[jx] - dlon), - c(lat[jy] - dlat, lat[jy] - dlat, - lat[jy] + dlat, lat[jy] + dlat)) - if (is.na(var[jx, jy] > 0)) { - col <- colNA - } else if (var[jx, jy] <= brks[1]) { - col <- col_inf_image - } else if (var[jx, jy] >= tail(brks, 1)) { - col <- col_sup_image - } else { - ind <- which(brks[-1] >= var[jx, jy] & var[jx, jy] > brks[-length(brks)]) - col <- cols[ind] + for (jx in 1:dims[1]) { + for (jy in 1:length(lat_plot_ind)) { + coord <- mapproj::mapproject(c(lon[jx] - dlon, lon[jx] + dlon, + lon[jx] + dlon, lon[jx] - dlon), + c(lat[lat_plot_ind][jy] - dlat, lat[lat_plot_ind][jy] - dlat, + lat[lat_plot_ind][jy] + dlat, lat[lat_plot_ind][jy] + dlat)) + if (is.na(var[jx, lat_plot_ind[jy]] > 0)) { + col <- colNA + } else if (var[jx, lat_plot_ind[jy]] <= brks[1]) { + col <- col_inf_image + } else if (var[jx, lat_plot_ind[jy]] >= tail(brks, 1)) { + col <- col_sup_image + } else { + ind <- which(brks[-1] >= var[jx, lat_plot_ind[jy]] & var[jx, lat_plot_ind[jy]] > brks[-length(brks)]) + col <- cols[ind] + } + polygon(coord, col = col, border = NA) + } + } + + # contours + if (!is.null(contours)) { + nbrks2 <- length(brks2) + for (n_brks2 in 1:nbrks2) { + cl <- grDevices::contourLines(x = lonb$x, y = latb$x[latb_plot_ind], + z = contours[lonb$ix, latb$ix[latb_plot_ind]], + levels = brks2[n_brks2]) + if (length(cl) > 0) { + for (i in seq_along(cl)) { + xy <- mapproj::mapproject(cl[[i]]$x, cl[[i]]$y) + xc <- xy$x + yc <- xy$y + nc <- length(xc) + lines(xc, yc, col = contour_color, lwd = contour_lwd, lty = contour_lty) + + # draw label + if (contour_label_draw) { + label_char <- as.character(signif(brks2[n_brks2], 2)) + ## Check if the label has enough space to draw first. + last_slope <- Inf + put_label <- FALSE + for (p1 in 1:nc) { + p2 <- p1 + while (p2 < nc) { + dist <- sqrt((yc[p2] - yc[p1])^2 + (xc[p2] - xc[p1])^2) + if (!is.infinite(dist) & + dist > 1.2 * strwidth(label_char, cex = contour_label_scale)) { + put_label <- TRUE + slope <- (yc[p2] - yc[p1]) / (xc[p2] - xc[p1]) + # flatter is better + if (abs(slope) < abs(last_slope)) { + last_slope <- slope + last_p1 <- p1 + last_p2 <- p2 + } + break # Found a proper space for label. Move to the next p1. + } + p2 <- p2 + 1 # If the dist is not enough, try next p2. + } + } + + ## If label can be put + if (put_label) { + # Label should be at the middle of p1 and p2 + p_label <- (last_p1 + last_p2) / 2 + # string rotation angle is calculated from the slope + srt_label <- atan(last_slope) * 57.2958 # radian to degree + + #NOTE: 'cex' in text() is the scale factor. The actual size will be + # contour_label_scale * par("cex") + text(xc[p_label], yc[p_label], label_char, + cex = contour_label_scale, col = contour_color, srt = srt_label) + } + } } - polygon(coord, col = col, border = NA) } } } + # Draw the dots if (!is.null(dots)) { numbfig <- 1 # for compatibility with PlotEquiMap code - dots <- dots[, , which(lat >= latlims[1] & lat <= latlims[2]), drop = FALSE] - data_avail <- !is.na(var[, which(lat >= latlims[1] & lat <= latlims[2]), drop = FALSE]) + dots <- dots[, , lat_plot_ind, drop = FALSE] + data_avail <- !is.na(var[, lat_plot_ind, drop = FALSE]) for (counter in 1:(dim(dots)[1])) { points <- which(dots[counter, , ] & data_avail, arr.ind = TRUE) - points_proj <- mapproj::mapproject(lon[points[, 1]], lat[points[, 2]]) + points_proj <- mapproj::mapproject(lon[points[, 1]], lat[lat_plot_ind][points[, 2]]) points(points_proj$x, points_proj$y, pch = dot_symbol[counter], cex = dot_size[counter] * 3 / sqrt(sqrt(sum(lat >= latlims[which.min(abs(latlims))]) * length(lon))), @@ -542,6 +770,84 @@ PlotStereoMap <- function(var, lon, lat, latlims = c(60, 90), } } + # + # PlotWind + # ~~~~~~~~~~ + # + if (!is.null(varu) && !is.null(varv)) { + # Create a two dimention array of longitude and latitude + lontab <- InsertDim(lonb$x, 2, length(latb$x[latb_plot_ind]), name = 'lat') + lattab <- InsertDim(latb$x[latb_plot_ind], 1, length(lonb$x), name = 'lon') + # Select a subsample of the points to an arrow for each "subsample" grid point + # latmin has the most arrows, and latmax (polar point) has no arrow. + sublon_max <- seq(1, length(lonb$x), arr_subsamp) + sublat_max <- seq(1, length(latb$x[latb_plot_ind]), arr_subsamp) + ## calculate the length of sublon for each lat + arr_num_at_lat <- round(seq(length(sublon_max), 0, length.out = length(lat[lat_plot_ind]))) + ## If south hemisphere, revserse arr_num_at_lat (smaller lat has less arrows) + if (center_at < 0) { + arr_num_at_lat <- rev(arr_num_at_lat) + } + for (n_lat in seq_along(sublat_max)) { + sublat <- sublat_max[n_lat] + if (arr_num_at_lat[sublat] != 0) { + sublon <- round(seq(1, length(lon), length.out = arr_num_at_lat[sublat])) + # end points (start points + varu/varv) + uaux <- lontab[sublon, sublat] + varu[lonb$ix, latb$ix[latb_plot_ind]][sublon, sublat] * 0.5 * arr_scale + vaux <- lattab[sublon, sublat] + varv[lonb$ix, latb$ix[latb_plot_ind]][sublon, sublat] * 0.5 * arr_scale + + # project the start and end points on stereographic + xy0 <- mapproj::mapproject(lontab[sublon, sublat], lattab[sublon, sublat]) + xy1 <- mapproj::mapproject(uaux, vaux) + xc0 <- xy0$x + yc0 <- xy0$y + xc1 <- xy1$x + yc1 <- xy1$y + nc <- length(xc0) + + lenshaft <- 0.18 * arr_scale * arr_scale_shaft + angleshaft <- 12 * arr_scale_shaft_angle + + # Plot Wind + arrows(xc0, yc0, + xc1, yc1, + angle = angleshaft, + length = lenshaft) + } + } + + # Plot an arrow at the bottom of the plot for the legend + # Put arrow at lon = 0, lat = lowest lat (i.e., biggest circle) - (latmax - latmin)/8 + delta_arr_lengend <- (0.5 * arr_scale * arr_ref_len) + posarlon <- c(0 - delta_arr_lengend / 2, 0 + delta_arr_lengend / 2) + posarlat <- rep(min(abs(lat[lat_plot_ind])) - diff(range(lat[lat_plot_ind]))/8, 2) +#NOTE: The following lines put legend at bottom left corner. But it's hard to put it horizontal +# delta_arr_lengend <- (0.5 * arr_scale * arr_ref_len)/sqrt(2) +# posarlat[1] <- posarlat[1] - delta_arr_lengend / 2 +# posarlat[2] <- posarlat[2] + delta_arr_lengend / 2 + ## turn into stereographic + arr_lengend <- mapproj::mapproject(posarlon, posarlat) + + arrows(arr_lengend$x[1], arr_lengend$y[1], + arr_lengend$x[2], arr_lengend$y[2], + length = lenshaft, angle = angleshaft, + xpd = TRUE) + #save the parameter value + xpdsave <- par('xpd') + #desactivate xpd to be able to plot in margen + par(xpd = NA) + #plot text + mtext(paste(as.character(arr_ref_len), arr_units, sep = ""), + line = min(arr_lengend$y) + 1.8 * abs(min(arr_lengend$y)), + side = 1, + at = mean(arr_lengend$x), + cex = units_scale) + #come back to the previous xpd value + par(xpd = xpdsave) + + } + + # # Colorbar # ~~~~~~~~~~ diff --git a/man/PlotStereoMap.Rd b/man/PlotStereoMap.Rd index 3bf2f69c..297358e0 100644 --- a/man/PlotStereoMap.Rd +++ b/man/PlotStereoMap.Rd @@ -4,19 +4,68 @@ \alias{PlotStereoMap} \title{Maps A Two-Dimensional Variable On A Polar Stereographic Projection} \usage{ -PlotStereoMap(var, lon, lat, latlims = c(60, 90), toptitle = NULL, - sizetit = NULL, units = NULL, brks = NULL, cols = NULL, - bar_limits = NULL, triangle_ends = NULL, col_inf = NULL, - col_sup = NULL, colNA = NULL, color_fun = clim.palette(), - filled.continents = FALSE, coast_color = NULL, coast_width = 1, - dots = NULL, dot_symbol = 4, dot_size = 0.8, intlat = 10, - drawleg = TRUE, subsampleg = NULL, bar_extra_labels = NULL, - draw_bar_ticks = TRUE, draw_separators = FALSE, triangle_ends_scale = 1, - bar_label_digits = 4, bar_label_scale = 1, units_scale = 1, - bar_tick_scale = 1, bar_extra_margin = rep(0, 4), boxlim = NULL, - boxcol = "purple2", boxlwd = 5, margin_scale = rep(1, 4), - title_scale = 1, numbfig = NULL, fileout = NULL, width = 6, - height = 5, size_units = "in", res = 100, ...) +PlotStereoMap( + var, + lon, + lat, + varu = NULL, + varv = NULL, + latlims = c(60, 90), + toptitle = NULL, + sizetit = NULL, + units = NULL, + brks = NULL, + cols = NULL, + bar_limits = NULL, + triangle_ends = NULL, + col_inf = NULL, + col_sup = NULL, + colNA = NULL, + color_fun = clim.palette(), + filled.continents = FALSE, + coast_color = NULL, + coast_width = 1, + contours = NULL, + brks2 = NULL, + contour_lwd = 0.5, + contour_color = "black", + contour_lty = 1, + contour_label_draw = TRUE, + contour_label_scale = 0.6, + dots = NULL, + dot_symbol = 4, + dot_size = 0.8, + intlat = 10, + arr_subsamp = floor(length(lon)/30), + arr_scale = 1, + arr_ref_len = 15, + arr_units = "m/s", + arr_scale_shaft = 1, + arr_scale_shaft_angle = 1, + drawleg = TRUE, + subsampleg = NULL, + bar_extra_labels = NULL, + draw_bar_ticks = TRUE, + draw_separators = FALSE, + triangle_ends_scale = 1, + bar_label_digits = 4, + bar_label_scale = 1, + units_scale = 1, + bar_tick_scale = 1, + bar_extra_margin = rep(0, 4), + boxlim = NULL, + boxcol = "purple2", + boxlwd = 5, + margin_scale = rep(1, 4), + title_scale = 1, + numbfig = NULL, + fileout = NULL, + width = 6, + height = 5, + size_units = "in", + res = 100, + ... +) } \arguments{ \item{var}{Array with the values at each cell of a grid on a regular @@ -38,6 +87,12 @@ longitude range can also be provided, e.g. \code{lon = c(0:50, 300:360)} grid of 'var', in any order (same as 'var'). Expected to be from a regular rectangular or gaussian grid, within the range [-90, 90].} +\item{varu}{Array of the zonal component of wind/current/other field with +the same dimensions as 'var'.} + +\item{varv}{Array of the meridional component of wind/current/other field +with the same dimensions as 'var'.} + \item{latlims}{Latitudinal limits of the figure.\cr Example : c(60, 90) for the North Pole\cr c(-90,-60) for the South Pole} @@ -82,6 +137,31 @@ continents. Takes the value gray(0.5) by default.} \item{coast_width}{Line width of the coast line of the drawn projected continents. Takes the value 1 by default.} +\item{contours}{Array of same dimensions as 'var' to be added to the plot +and displayed with contours. Parameter 'brks2' is required to define the +magnitude breaks for each contour curve.} + +\item{brks2}{A numeric value or vector of magnitude breaks where to draw +contour curves for the array provided in 'contours'. If it is a number, it +represents the number of breaks (n) that defines (n - 1) intervals to +classify 'contours'.} + +\item{contour_lwd}{Line width of the contour curves provided via 'contours' +and 'brks2'. The default value is 0.5.} + +\item{contour_color}{Line color of the contour curves provided via 'contours' +and 'brks2'.} + +\item{contour_lty}{Line type of the contour curves. Takes 1 (solid) by +default. See help on 'lty' in par() for other accepted values.} + +\item{contour_label_draw}{A logical value indicating whether to draw the +contour labels (TRUE) or not (FALSE) when 'contours' is used. The default +value is TRUE.} + +\item{contour_label_scale}{Scale factor for the superimposed labels when +drawing contour levels. The default value is 0.6.} + \item{dots}{Array of same dimensions as 'var' or with dimensions c(n, dim(var)), where n is the number of dot/symbol layers to add to the plot. A value of TRUE at a grid cell will draw a dot/symbol on the @@ -102,6 +182,29 @@ layers in 'dots'. Takes 1 by default.} \item{intlat}{Interval between latitude lines (circles), in degrees. Defaults to 10.} +\item{arr_subsamp}{A number as subsampling factor to select a subset of arrows +in 'varu' and 'varv' to be drawn. Only one out of arr_subsamp arrows will +be drawn. The default value is 1.} + +\item{arr_scale}{A number as scale factor for drawn arrows from 'varu' and +'varv'. The default value is 1.} + +\item{arr_ref_len}{A number of the length of the refence arrow to be drawn as +legend at the bottom of the figure (in same units as 'varu' and 'varv', only +affects the legend for the wind or variable in these arrays). The default +value is 15.} + +\item{arr_units}{Units of 'varu' and 'varv', to be drawn in the legend. +Takes 'm/s' by default.} + +\item{arr_scale_shaft}{A number for the scale of the shaft of the arrows +(which also depend on the number of figures and the arr_scale parameter). +The default value is 1.} + +\item{arr_scale_shaft_angle}{A number for the scale of the angle of the +shaft of the arrows (which also depend on the number of figure and the +arr_scale parameter). The default value is 1.} + \item{drawleg}{Whether to plot a color bar (legend, key) or not. Defaults to TRUE.} @@ -172,8 +275,8 @@ Map longitude-latitude array (on a regular rectangular or gaussian grid) on a polar stereographic world projection with coloured grid cells. Only the region within a specified latitude interval is displayed. A colour bar (legend) can be plotted and adjusted. It is possible to draw superimposed -dots, symbols and boxes. A number of options is provided to adjust the -position, size and colour of the components. This plot function is +dots, symbols, boxes, contours, and arrows. A number of options is provided to +adjust the position, size and colour of the components. This plot function is compatible with figure layouts if colour bar is disabled. } \examples{ @@ -192,4 +295,3 @@ History:\cr border and Constantin boxes. } \keyword{dynamic} - -- GitLab From 3fe22a8973746d70d5e2d52d401ab25195735c5a Mon Sep 17 00:00:00 2001 From: aho Date: Thu, 3 Jun 2021 20:04:25 +0200 Subject: [PATCH 3/6] Update doc due to roxygen version --- DESCRIPTION | 2 +- man/ACC.Rd | 21 +++++--- man/Alpha.Rd | 1 - man/AnimateMap.Rd | 33 +++++++++--- man/Ano.Rd | 1 - man/Ano_CrossValid.Rd | 1 - man/ArrayToNetCDF.Rd | 1 - man/BrierScore.Rd | 13 +++-- man/CDORemap.Rd | 14 +++-- man/Clim.Rd | 1 - man/Cluster.Rd | 9 ++-- man/ColorBar.Rd | 32 +++++++++--- man/Composite.Rd | 1 - man/ConfigApplyMatchingEntries.Rd | 21 +++++--- man/ConfigEditDefinition.Rd | 9 ++-- man/ConfigEditEntry.Rd | 53 +++++++++++++------ man/ConfigFileOpen.Rd | 13 +++-- man/ConfigShowSimilarEntries.Rd | 27 ++++++---- man/ConfigShowTable.Rd | 13 +++-- man/Consist_Trend.Rd | 1 - man/Corr.Rd | 21 +++++--- man/EOF.Rd | 7 ++- man/Enlarge.Rd | 1 - man/Eno.Rd | 1 - man/EnoNew.Rd | 11 ++-- man/Filter.Rd | 1 - man/FitAcfCoef.Rd | 1 - man/FitAutocor.Rd | 1 - man/GenSeries.Rd | 1 - man/Histo2Hindcast.Rd | 1 - man/IniListDims.Rd | 1 - man/InsertDim.Rd | 1 - man/LeapYear.Rd | 1 - man/Load.Rd | 40 ++++++++++---- man/Mean1Dim.Rd | 1 - man/MeanListDim.Rd | 1 - man/NAO.Rd | 21 +++++--- man/Plot2VarsVsLTime.Rd | 31 ++++++++--- man/PlotACC.Rd | 27 +++++++--- man/PlotAno.Rd | 31 ++++++++--- man/PlotBoxWhisker.Rd | 29 ++++++++--- man/PlotClim.Rd | 26 +++++++--- man/PlotEquiMap.Rd | 86 ++++++++++++++++++++++++------- man/PlotLayout.Rd | 73 ++++++++++++++++++-------- man/PlotMatrix.Rd | 29 ++++++++--- man/PlotSection.Rd | 25 +++++++-- man/PlotVsLTime.Rd | 30 ++++++++--- man/ProbBins.Rd | 12 +++-- man/ProjectField.Rd | 7 ++- man/RMS.Rd | 15 ++++-- man/RMSSS.Rd | 3 +- man/RatioRMS.Rd | 3 +- man/RatioSDRMS.Rd | 3 +- man/Regression.Rd | 1 - man/SVD.Rd | 12 +++-- man/Season.Rd | 1 - man/SelIndices.Rd | 1 - man/Smoothing.Rd | 1 - man/Spectrum.Rd | 1 - man/Spread.Rd | 1 - man/StatSeasAtlHurr.Rd | 9 ++-- man/Subset.Rd | 1 - man/ToyModel.Rd | 15 ++++-- man/Trend.Rd | 3 +- man/UltimateBrier.Rd | 15 ++++-- man/clim.palette.Rd | 3 +- man/s2dverification.Rd | 9 +++- man/sampleDepthData.Rd | 1 - man/sampleMap.Rd | 1 - man/sampleTimeSeries.Rd | 1 - 70 files changed, 600 insertions(+), 285 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 99565b9b..99ba5031 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -61,4 +61,4 @@ BugReports: https://earth.bsc.es/gitlab/es/s2dverification/-/issues LazyData: true SystemRequirements: cdo Encoding: UTF-8 -RoxygenNote: 5.0.0 +RoxygenNote: 7.0.1 diff --git a/man/ACC.Rd b/man/ACC.Rd index e3db377f..61b286f2 100644 --- a/man/ACC.Rd +++ b/man/ACC.Rd @@ -4,8 +4,16 @@ \alias{ACC} \title{Computes Anomaly Correlation Coefficient} \usage{ -ACC(var_exp, var_obs, lon = NULL, lat = NULL, lonlatbox = NULL, - conf = TRUE, conftype = "parametric", siglev = 0.95) +ACC( + var_exp, + var_obs, + lon = NULL, + lat = NULL, + lonlatbox = NULL, + conf = TRUE, + conftype = "parametric", + siglev = 0.95 +) } \arguments{ \item{var_exp}{Array of experimental anomalies with dimensions: @@ -97,6 +105,10 @@ acc <- ACC(Mean1Dim(ano_exp, 2), Mean1Dim(ano_obs, 2)) PlotACC(acc$ACC, startDates) } } +\references{ +Joliffe and Stephenson (2012). Forecast Verification: A + Practitioner's Guide in Atmospheric Science. Wiley-Blackwell. +} \author{ History:\cr 0.1 - 2013-08 (V. Guemas, \email{virginie.guemas@bsc.es}) - Original code\cr @@ -107,9 +119,4 @@ History:\cr 1.3.1 - 2014-09 (C. Prodhomme, \email{chloe.prodhomme@bsc.es}) - Add comments and minor style changes\cr 1.3.2 - 2015-02 (N. Manubens, \email{nicolau.manubens@bsc.es}) - Fixed ACC documentation and examples } -\references{ -Joliffe and Stephenson (2012). Forecast Verification: A - Practitioner's Guide in Atmospheric Science. Wiley-Blackwell. -} \keyword{datagen} - diff --git a/man/Alpha.Rd b/man/Alpha.Rd index c2350b2a..26596dc2 100644 --- a/man/Alpha.Rd +++ b/man/Alpha.Rd @@ -42,4 +42,3 @@ History:\cr 1.0 - 2013-09 (N. Manubens, \email{nicolau.manubens@ic3.cat}) - Formatting to CRAN } \keyword{datagen} - diff --git a/man/AnimateMap.Rd b/man/AnimateMap.Rd index 96074b01..5dc756da 100644 --- a/man/AnimateMap.Rd +++ b/man/AnimateMap.Rd @@ -4,13 +4,33 @@ \alias{AnimateMap} \title{Animate Maps of Forecast/Observed Values or Scores Over Forecast Time} \usage{ -AnimateMap(var, lon, lat, toptitle = rep("", 11), sizetit = 1, units = "", - monini = 1, freq = 12, msk95lev = FALSE, brks = NULL, cols = NULL, - filled.continents = FALSE, lonmin = 0, lonmax = 360, latmin = -90, - latmax = 90, intlon = 20, intlat = 30, drawleg = TRUE, - subsampleg = 1, colNA = "white", equi = TRUE, +AnimateMap( + var, + lon, + lat, + toptitle = rep("", 11), + sizetit = 1, + units = "", + monini = 1, + freq = 12, + msk95lev = FALSE, + brks = NULL, + cols = NULL, + filled.continents = FALSE, + lonmin = 0, + lonmax = 360, + latmin = -90, + latmax = 90, + intlon = 20, + intlat = 30, + drawleg = TRUE, + subsampleg = 1, + colNA = "white", + equi = TRUE, fileout = c("output1_animvsltime.gif", "output2_animvsltime.gif", - "output3_animvsltime.gif"), ...) + "output3_animvsltime.gif"), + ... +) } \arguments{ \item{var}{Matrix of dimensions (nltime, nlat, nlon) or @@ -194,4 +214,3 @@ History:\cr 1.2 - 2015-05 (V. Guemas, \email{virginie.guemas@bsc.es}) - Use of PlotEquiMap and PlotStereoMap } \keyword{dynamic} - diff --git a/man/Ano.Rd b/man/Ano.Rd index 6143be88..6461ec77 100644 --- a/man/Ano.Rd +++ b/man/Ano.Rd @@ -49,4 +49,3 @@ History:\cr 1.0 - 2013-09 (N. Manubens, \email{nicolau.manubens@ic3.cat}) - Formatting to R CRAN } \keyword{datagen} - diff --git a/man/Ano_CrossValid.Rd b/man/Ano_CrossValid.Rd index 85d1badb..70017492 100644 --- a/man/Ano_CrossValid.Rd +++ b/man/Ano_CrossValid.Rd @@ -43,4 +43,3 @@ History:\cr 1.0 - 2013-09 (N. Manubens, \email{nicolau.manubens@ic3.cat}) - Formatting to CRAN } \keyword{datagen} - diff --git a/man/ArrayToNetCDF.Rd b/man/ArrayToNetCDF.Rd index 77cbfaf8..4e05d829 100644 --- a/man/ArrayToNetCDF.Rd +++ b/man/ArrayToNetCDF.Rd @@ -238,4 +238,3 @@ History:\cr 0.0 - 2017-01 (N. Manubens, \email{nicolau.manubens@bsc.es}) - Original code. } \keyword{datagen} - diff --git a/man/BrierScore.Rd b/man/BrierScore.Rd index 5094987c..e802dc35 100644 --- a/man/BrierScore.Rd +++ b/man/BrierScore.Rd @@ -1,8 +1,8 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/BrierScore.R \name{BrierScore} -\alias{.BrierScore} \alias{BrierScore} +\alias{.BrierScore} \title{Compute Brier Score And Its Decomposition And Brier Skill Score} \usage{ BrierScore(obs, pred, thresholds = seq(0, 1, 0.1)) @@ -85,11 +85,6 @@ bs2 <- veriApply("BrierScore2", bins_ano_exp, Mean1Dim(bins_ano_ob,s 3), tdim = 2, ensdim = 3) } } -\author{ -History:\cr - 0.1 - 2012-04 (L. Rodrigues, \email{lrodrigues@ic3.cat}) - Original code\cr - 0.2 - 2017-02 (A. Hunter, \email{alasdair.hunter@bsc.es}) - Adapted to veriApply() -} \references{ Wilks (2006) Statistical Methods in the Atmospheric Sciences.\cr Stephenson et al. (2008). Two extra components in the Brier score decomposition. @@ -97,5 +92,9 @@ Stephenson et al. (2008). Two extra components in the Brier score decomposition. Ferro and Fricker (2012). A bias-corrected decomposition of the BS. Quarterly Journal of the Royal Meteorological Society, DOI: 10.1002/qj.1924. } +\author{ +History:\cr + 0.1 - 2012-04 (L. Rodrigues, \email{lrodrigues@ic3.cat}) - Original code\cr + 0.2 - 2017-02 (A. Hunter, \email{alasdair.hunter@bsc.es}) - Adapted to veriApply() +} \keyword{datagen} - diff --git a/man/CDORemap.Rd b/man/CDORemap.Rd index b2d5eaa3..bae7aa55 100644 --- a/man/CDORemap.Rd +++ b/man/CDORemap.Rd @@ -4,8 +4,17 @@ \alias{CDORemap} \title{Interpolates arrays with longitude and latitude dimensions using CDO} \usage{ -CDORemap(data_array = NULL, lons, lats, grid, method, avoid_writes = TRUE, - crop = TRUE, force_remap = FALSE, write_dir = tempdir()) +CDORemap( + data_array = NULL, + lons, + lats, + grid, + method, + avoid_writes = TRUE, + crop = TRUE, + force_remap = FALSE, + write_dir = tempdir() +) } \arguments{ \item{data_array}{Multidimensional numeric array to be interpolated. If @@ -226,4 +235,3 @@ History:\cr 0.0 - 2017-01 (N. Manubens, \email{nicolau.manubens@bsc.es}) - Original code. } \keyword{datagen} - diff --git a/man/Clim.Rd b/man/Clim.Rd index 1ef5e3da..69f7ceb0 100644 --- a/man/Clim.Rd +++ b/man/Clim.Rd @@ -63,4 +63,3 @@ History:\cr 1.0 - 2013-09 (N. Manubens, \email{nicolau.manubens@ic3.cat}) - Formatting to R CRAN } \keyword{datagen} - diff --git a/man/Cluster.Rd b/man/Cluster.Rd index 70f22347..782c37a4 100644 --- a/man/Cluster.Rd +++ b/man/Cluster.Rd @@ -92,7 +92,7 @@ for (i1 in c1) { a1[i1, ] <- x1 + rnorm(4, mean = mean1, sd = sd1) } -c1p5 <- c0[!(c0 \\\%in\\\% c1)] +c1p5 <- c0[!(c0 \\%in\\% c1)] c2 <- c1p5[seq(1, length(c1p5), 2)] x2 <- c(2, 2, 4, 4) for (i2 in c2) { @@ -114,12 +114,11 @@ res2 <- Cluster(var = a1, weights = array(1, dim = dim(a1)[2])) print(res2$cluster) print(res2$centers) } +\references{ +Wilks, 2011, Statistical Methods in the Atmospheric Sciences, 3rd ed., Elsevire, pp 676. +} \author{ History:\cr 1.0 # 2014-10 (N.S. Fuckar, \email{neven.fuckar@bsc.es}) - Original code } -\references{ -Wilks, 2011, Statistical Methods in the Atmospheric Sciences, 3rd ed., Elsevire, pp 676. -} \keyword{datagen} - diff --git a/man/ColorBar.Rd b/man/ColorBar.Rd index 71da02be..98c99679 100644 --- a/man/ColorBar.Rd +++ b/man/ColorBar.Rd @@ -4,13 +4,30 @@ \alias{ColorBar} \title{Draws a Color Bar} \usage{ -ColorBar(brks = NULL, cols = NULL, vertical = TRUE, subsampleg = NULL, - bar_limits = NULL, var_limits = NULL, triangle_ends = NULL, - col_inf = NULL, col_sup = NULL, color_fun = clim.palette(), - plot = TRUE, draw_ticks = TRUE, draw_separators = FALSE, - triangle_ends_scale = 1, extra_labels = NULL, title = NULL, - title_scale = 1, label_scale = 1, tick_scale = 1, - extra_margin = rep(0, 4), label_digits = 4, ...) +ColorBar( + brks = NULL, + cols = NULL, + vertical = TRUE, + subsampleg = NULL, + bar_limits = NULL, + var_limits = NULL, + triangle_ends = NULL, + col_inf = NULL, + col_sup = NULL, + color_fun = clim.palette(), + plot = TRUE, + draw_ticks = TRUE, + draw_separators = FALSE, + triangle_ends_scale = 1, + extra_labels = NULL, + title = NULL, + title_scale = 1, + label_scale = 1, + tick_scale = 1, + extra_margin = rep(0, 4), + label_digits = 4, + ... +) } \arguments{ \item{brks}{Can be provided in two formats: @@ -185,4 +202,3 @@ History:\cr (V. Torralba, \email{veronica.torralba@bsc.es}) } \keyword{hplot} - diff --git a/man/Composite.Rd b/man/Composite.Rd index 3d9a3fd8..927d8a56 100644 --- a/man/Composite.Rd +++ b/man/Composite.Rd @@ -91,4 +91,3 @@ History: 0.1 # 2014-08 (N.S. Fuckar, \email{neven.fuckar@bsc.es}) # Original code } \keyword{datagen} - diff --git a/man/ConfigApplyMatchingEntries.Rd b/man/ConfigApplyMatchingEntries.Rd index 626e385d..74abb167 100644 --- a/man/ConfigApplyMatchingEntries.Rd +++ b/man/ConfigApplyMatchingEntries.Rd @@ -4,8 +4,14 @@ \alias{ConfigApplyMatchingEntries} \title{Apply Matching Entries To Dataset Name And Variable Name To Find Related Info} \usage{ -ConfigApplyMatchingEntries(configuration, var, exp = NULL, obs = NULL, - show_entries = FALSE, show_result = TRUE) +ConfigApplyMatchingEntries( + configuration, + var, + exp = NULL, + obs = NULL, + show_entries = FALSE, + show_result = TRUE +) } \arguments{ \item{configuration}{Configuration object obtained from ConfigFileOpen() @@ -63,15 +69,14 @@ configuration <- ConfigEditEntry(configuration, "experiments", 1, match_info <- ConfigApplyMatchingEntries(configuration, 'tas', exp = c('ExampleExperiment2'), show_result = TRUE) } -\author{ -History:\cr - 0.1 - 2015-05 (N. Manubens, \email{nicolau.manubens@ic3.cat}) - First version\cr - 1.0 - 2015-11 (N. Manubens, \email{nicolau.manubens@ic3.cat}) - Removed grid column and storage types -} \seealso{ ConfigApplyMatchingEntries, ConfigEditDefinition, ConfigEditEntry, ConfigFileOpen, ConfigShowSimilarEntries, ConfigShowTable } +\author{ +History:\cr + 0.1 - 2015-05 (N. Manubens, \email{nicolau.manubens@ic3.cat}) - First version\cr + 1.0 - 2015-11 (N. Manubens, \email{nicolau.manubens@ic3.cat}) - Removed grid column and storage types +} \keyword{datagen} - diff --git a/man/ConfigEditDefinition.Rd b/man/ConfigEditDefinition.Rd index b1f7c882..a25a9c3b 100644 --- a/man/ConfigEditDefinition.Rd +++ b/man/ConfigEditDefinition.Rd @@ -52,14 +52,13 @@ match_info <- ConfigApplyMatchingEntries(configuration, 'tas', exp = c('ExampleExperiment2'), show_result = TRUE) } -\author{ -History: - 0.1 - 2015-05 (N. Manubens, \email{nicolau.manubens@ic3.cat}) - First version -} \seealso{ [ConfigApplyMatchingEntries()], [ConfigEditDefinition()], [ConfigEditEntry()], [ConfigFileOpen()], [ConfigShowSimilarEntries()], [ConfigShowTable()]. } +\author{ +History: + 0.1 - 2015-05 (N. Manubens, \email{nicolau.manubens@ic3.cat}) - First version +} \keyword{datagen} - diff --git a/man/ConfigEditEntry.Rd b/man/ConfigEditEntry.Rd index 83973231..2b13d0b9 100644 --- a/man/ConfigEditEntry.Rd +++ b/man/ConfigEditEntry.Rd @@ -1,22 +1,46 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/ConfigEditEntry.R \name{ConfigEditEntry} -\alias{ConfigAddEntry} \alias{ConfigEditEntry} +\alias{ConfigAddEntry} \alias{ConfigRemoveEntry} \title{Add, Remove Or Edit Entries In The Configuration} \usage{ -ConfigEditEntry(configuration, dataset_type, position, dataset_name = NULL, - var_name = NULL, main_path = NULL, file_path = NULL, - nc_var_name = NULL, suffix = NULL, varmin = NULL, varmax = NULL) +ConfigEditEntry( + configuration, + dataset_type, + position, + dataset_name = NULL, + var_name = NULL, + main_path = NULL, + file_path = NULL, + nc_var_name = NULL, + suffix = NULL, + varmin = NULL, + varmax = NULL +) -ConfigAddEntry(configuration, dataset_type, position = "last", - dataset_name = ".*", var_name = ".*", main_path = "*", - file_path = "*", nc_var_name = "*", suffix = "*", varmin = "*", - varmax = "*") +ConfigAddEntry( + configuration, + dataset_type, + position = "last", + dataset_name = ".*", + var_name = ".*", + main_path = "*", + file_path = "*", + nc_var_name = "*", + suffix = "*", + varmin = "*", + varmax = "*" +) -ConfigRemoveEntry(configuration, dataset_type, dataset_name = NULL, - var_name = NULL, position = NULL) +ConfigRemoveEntry( + configuration, + dataset_type, + dataset_name = NULL, + var_name = NULL, + position = NULL +) } \arguments{ \item{configuration}{Configuration object obtained via ConfigFileOpen() @@ -95,14 +119,13 @@ ConfigShowTable(configuration, "experiments") # Save the configuration ConfigFileSave(configuration, config_file, confirm = FALSE) } +\seealso{ +ConfigApplyMatchingEntries, ConfigEditDefinition, ConfigEditEntry, + ConfigFileOpen, ConfigShowSimilarEntries, ConfigShowTable +} \author{ History:\cr 0.1 - 2015-05 (N. Manubens, \email{nicolau.manubens@ic3.cat}) - First version\cr 1.0 - 2015-11 (N. Manubens, \email{nicolau.manubens@ic3.cat}) - Removed grid column and storage formats } -\seealso{ -ConfigApplyMatchingEntries, ConfigEditDefinition, ConfigEditEntry, - ConfigFileOpen, ConfigShowSimilarEntries, ConfigShowTable -} \keyword{datagen} - diff --git a/man/ConfigFileOpen.Rd b/man/ConfigFileOpen.Rd index 3630c155..1bdb9a34 100644 --- a/man/ConfigFileOpen.Rd +++ b/man/ConfigFileOpen.Rd @@ -1,8 +1,8 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/ConfigFileOpen.R \name{ConfigFileOpen} -\alias{ConfigFileCreate} \alias{ConfigFileOpen} +\alias{ConfigFileCreate} \alias{ConfigFileSave} \title{Functions To Create Open And Save Configuration File} \usage{ @@ -185,11 +185,6 @@ match_info <- ConfigApplyMatchingEntries(configuration, 'tas', # Finally save the configuration file. ConfigFileSave(configuration, config_file, confirm = FALSE) -} -\author{ -History: - 0.1 - 2015-05 (N. Manubens, \email{nicolau.manubens@ic3.cat}) - First version - 1.0 - 2015-11 (N. Manubens, \email{nicolau.manubens@ic3.cat}) - Removed grid column and storage formats } \references{ [1] \url{https://stat.ethz.ch/R-manual/R-devel/library/base/html/regex.html}\cr @@ -199,5 +194,9 @@ History: ConfigApplyMatchingEntries, ConfigEditDefinition, ConfigEditEntry, ConfigFileOpen, ConfigShowSimilarEntries, ConfigShowTable } +\author{ +History: + 0.1 - 2015-05 (N. Manubens, \email{nicolau.manubens@ic3.cat}) - First version + 1.0 - 2015-11 (N. Manubens, \email{nicolau.manubens@ic3.cat}) - Removed grid column and storage formats +} \keyword{datagen} - diff --git a/man/ConfigShowSimilarEntries.Rd b/man/ConfigShowSimilarEntries.Rd index 312da795..154bcb28 100644 --- a/man/ConfigShowSimilarEntries.Rd +++ b/man/ConfigShowSimilarEntries.Rd @@ -4,10 +4,18 @@ \alias{ConfigShowSimilarEntries} \title{Find Similar Entries In Tables Of Datasets} \usage{ -ConfigShowSimilarEntries(configuration, dataset_name = NULL, - var_name = NULL, main_path = NULL, file_path = NULL, - nc_var_name = NULL, suffix = NULL, varmin = NULL, varmax = NULL, - n_results = 10) +ConfigShowSimilarEntries( + configuration, + dataset_name = NULL, + var_name = NULL, + main_path = NULL, + file_path = NULL, + nc_var_name = NULL, + suffix = NULL, + varmin = NULL, + varmax = NULL, + n_results = 10 +) } \arguments{ \item{configuration}{Configuration object obtained either from @@ -71,11 +79,6 @@ ConfigShowSimilarEntries(configuration, dataset_name = "Exper", var_name = "Vari") } -\author{ -History:\cr - 0.1 - 2015-05 (N. Manubens, \email{nicolau.manubens@ic3.cat}) - First version\cr - 1.0 - 2015-11 (N. Manubens, \email{nicolau.manubens@ic3.cat}) - Removed grid column and storage formats -} \references{ [1] Simon White, string seamness: \url{http://www.catalysoft.com/articles/StrikeAMatch.html} @@ -84,5 +87,9 @@ History:\cr ConfigApplyMatchingEntries, ConfigEditDefinition, ConfigEditEntry, ConfigFileOpen, ConfigShowSimilarEntries, ConfigShowTable } +\author{ +History:\cr + 0.1 - 2015-05 (N. Manubens, \email{nicolau.manubens@ic3.cat}) - First version\cr + 1.0 - 2015-11 (N. Manubens, \email{nicolau.manubens@ic3.cat}) - Removed grid column and storage formats +} \keyword{datagen} - diff --git a/man/ConfigShowTable.Rd b/man/ConfigShowTable.Rd index a06b643e..56649156 100644 --- a/man/ConfigShowTable.Rd +++ b/man/ConfigShowTable.Rd @@ -1,8 +1,8 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/ConfigShowTable.R \name{ConfigShowTable} -\alias{ConfigShowDefinitions} \alias{ConfigShowTable} +\alias{ConfigShowDefinitions} \title{Show Configuration Tables And Definitions} \usage{ ConfigShowTable(configuration, dataset_type, line_numbers = NULL) @@ -48,16 +48,15 @@ configuration <- ConfigEditEntry(configuration, "experiments", 1, ConfigShowTable(configuration, 'experiments') ConfigShowDefinitions(configuration) -} -\author{ -History:\cr - 0.1 - 2015-05 (N. Manubens, \email{nicolau.manubens@ic3.cat}) - First version\cr - 1.0 - 2015-11 (N. Manubens, \email{nicolau.manubens@ic3.cat}) - Removed grid column and storage formats } \seealso{ [ConfigApplyMatchingEntries()], [ConfigEditDefinition()], [ConfigEditEntry()], [ConfigFileOpen()], [ConfigShowSimilarEntries()], [ConfigShowTable()]. } +\author{ +History:\cr + 0.1 - 2015-05 (N. Manubens, \email{nicolau.manubens@ic3.cat}) - First version\cr + 1.0 - 2015-11 (N. Manubens, \email{nicolau.manubens@ic3.cat}) - Removed grid column and storage formats +} \keyword{datagen} - diff --git a/man/Consist_Trend.Rd b/man/Consist_Trend.Rd index d067dcd7..124e5e3d 100644 --- a/man/Consist_Trend.Rd +++ b/man/Consist_Trend.Rd @@ -80,4 +80,3 @@ History:\cr 1.0 - 2013-09 (N. Manubens, \email{nicolau.manubens@ic3.cat}) - Formatting to R CRAN } \keyword{datagen} - diff --git a/man/Corr.Rd b/man/Corr.Rd index e311813d..11a40d79 100644 --- a/man/Corr.Rd +++ b/man/Corr.Rd @@ -1,16 +1,24 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/Corr.R \name{Corr} -\alias{.Corr} \alias{Corr} +\alias{.Corr} \title{Computes the correlation coefficient between an array of forecasts and their corresponding observations} \usage{ -Corr(var_exp, var_obs, posloop = 1, poscor = 2, compROW = NULL, - limits = NULL, siglev = 0.95, method = "pearson", conf = TRUE, - pval = TRUE) +Corr( + var_exp, + var_obs, + posloop = 1, + poscor = 2, + compROW = NULL, + limits = NULL, + siglev = 0.95, + method = "pearson", + conf = TRUE, + pval = TRUE +) -.Corr(exp, obs, siglev = 0.95, method = "pearson", conf = TRUE, - pval = TRUE) +.Corr(exp, obs, siglev = 0.95, method = "pearson", conf = TRUE, pval = TRUE) } \arguments{ \item{var_exp}{Array of experimental data.} @@ -131,4 +139,3 @@ History:\cr 1.3 - 2017-02 (A. Hunter, \email{alasdair.hunter@bsc.es}) - Adapted to veriApply() } \keyword{datagen} - diff --git a/man/EOF.Rd b/man/EOF.Rd index bd0b31e4..25934f52 100644 --- a/man/EOF.Rd +++ b/man/EOF.Rd @@ -82,6 +82,9 @@ ano <- Ano_CrossValid(sampleData$mod, sampleData$obs) eof <- EOF(Mean1Dim(ano$ano_exp, 2)[1, , 1, , ], sampleData$lon, sampleData$lat) PlotEquiMap(eof$EOFs[1, , ], sampleData$lon, sampleData$lat) +} +\seealso{ +ProjectField, NAO, PlotBoxWhisker } \author{ History:\cr @@ -115,8 +118,4 @@ weighted by cos(lat)\cr EOF * PC\cr 1.0 - 2016-03 (N. Manubens, \email{nicolau.manubens@bsc.es}) - Formatting to R CRAN } -\seealso{ -ProjectField, NAO, PlotBoxWhisker -} \keyword{datagen} - diff --git a/man/Enlarge.Rd b/man/Enlarge.Rd index 76f5cccf..47aed320 100644 --- a/man/Enlarge.Rd +++ b/man/Enlarge.Rd @@ -29,4 +29,3 @@ History:\cr 1.1 - 2015-03 (N. Manubens, \email{nicolau.manubens@ic3.cat}) - Improved\cr } \keyword{datagen} - diff --git a/man/Eno.Rd b/man/Eno.Rd index ba4f2088..ea70bc5e 100644 --- a/man/Eno.Rd +++ b/man/Eno.Rd @@ -60,4 +60,3 @@ History:\cr 1.0 - 2013-09 (N. Manubens, \email{nicolau.manubens at ic3.cat}) - Formatting to R CRAN } \keyword{datagen} - diff --git a/man/EnoNew.Rd b/man/EnoNew.Rd index cc2de760..32bf55fd 100644 --- a/man/EnoNew.Rd +++ b/man/EnoNew.Rd @@ -55,16 +55,15 @@ sampleData <- s2dverification:::.LoadSampleData('tos', c('experiment'), eno <- EnoNew(sampleData$mod[1, 1, , 1, 2, 3]) print(eno) -} -\author{ -History:\cr -0.1 - 2012-06 (V. Guemas, \email{virginie.guemas at ic3.cat}) - Original code\cr -1.0 - 2013-09 (N. Manubens, \email{nicolau.manubens at ic3.cat}) - Formatting to CRAN } \references{ Guemas V, Auger L, Doblas-Reyes FJ, Rust H, Ribes A, 2014, Dependencies in Statistical Hypothesis Tests for Climate Time Series. Bulletin of the American Meteorological Society, 95 (11), 1666-1667. } +\author{ +History:\cr +0.1 - 2012-06 (V. Guemas, \email{virginie.guemas at ic3.cat}) - Original code\cr +1.0 - 2013-09 (N. Manubens, \email{nicolau.manubens at ic3.cat}) - Formatting to CRAN +} \keyword{datagen} - diff --git a/man/Filter.Rd b/man/Filter.Rd index 3e40f105..21807f5d 100644 --- a/man/Filter.Rd +++ b/man/Filter.Rd @@ -48,4 +48,3 @@ History:\cr 1.0 - 2012-02 (N. Manubens, \email{nicolau.manubens at ic3.cat}) - Formatting to CRAN } \keyword{datagen} - diff --git a/man/FitAcfCoef.Rd b/man/FitAcfCoef.Rd index 6ca51444..6de266e5 100644 --- a/man/FitAcfCoef.Rd +++ b/man/FitAcfCoef.Rd @@ -38,4 +38,3 @@ History:\cr 1.0 - 2013-09 (N. Manubens, \email{nicolau.manubens@ic3.cat}) - Formatting to CRAN } \keyword{datagen} - diff --git a/man/FitAutocor.Rd b/man/FitAutocor.Rd index ff3ab943..2d623603 100644 --- a/man/FitAutocor.Rd +++ b/man/FitAutocor.Rd @@ -35,4 +35,3 @@ History:\cr 1.0 - 2013-09 (N. Manubens, \email{nicolau.manubens@ic3.cat}) - Formatting to CRAN } \keyword{datagen} - diff --git a/man/GenSeries.Rd b/man/GenSeries.Rd index 9a49ed9d..549b259e 100644 --- a/man/GenSeries.Rd +++ b/man/GenSeries.Rd @@ -34,4 +34,3 @@ History:\cr 1.0 - 2012-04 (N. Manubens, \email{nicolau.manubens@ic3.cat}) - Formatting to CRAN } \keyword{datagen} - diff --git a/man/Histo2Hindcast.Rd b/man/Histo2Hindcast.Rd index 7000628a..0f9bd18b 100644 --- a/man/Histo2Hindcast.Rd +++ b/man/Histo2Hindcast.Rd @@ -79,4 +79,3 @@ History:\cr 1.0 - 2013-09 (N. Manubens, \email{nicolau.manubens@ic3.cat}) - Formatting to CRAN } \keyword{datagen} - diff --git a/man/IniListDims.Rd b/man/IniListDims.Rd index 422a4c76..71369945 100644 --- a/man/IniListDims.Rd +++ b/man/IniListDims.Rd @@ -39,4 +39,3 @@ History:\cr 1.1 - 2015-03 (N. Manubens, \email{nicolau.manubens@ic3.cat}) - Improved } \keyword{datagen} - diff --git a/man/InsertDim.Rd b/man/InsertDim.Rd index 4cdc5377..e7e50d14 100644 --- a/man/InsertDim.Rd +++ b/man/InsertDim.Rd @@ -34,4 +34,3 @@ History:\cr 1.1 - 2015-03 (N. Manubens, \email{nicolau.manubens@ic3.cat}) - Improvements } \keyword{datagen} - diff --git a/man/LeapYear.Rd b/man/LeapYear.Rd index 12b02b49..7504a27e 100644 --- a/man/LeapYear.Rd +++ b/man/LeapYear.Rd @@ -27,4 +27,3 @@ History:\cr 1.0 - 2013-09 (N. Manubens, \email{nicolau.manubens@ic3.cat}) - Formatting to CRAN } \keyword{datagen} - diff --git a/man/Load.Rd b/man/Load.Rd index c721e613..6554f58b 100644 --- a/man/Load.Rd +++ b/man/Load.Rd @@ -4,15 +4,36 @@ \alias{Load} \title{Loads Experimental And Observational Data} \usage{ -Load(var, exp = NULL, obs = NULL, sdates, nmember = NULL, - nmemberobs = NULL, nleadtime = NULL, leadtimemin = 1, - leadtimemax = NULL, storefreq = "monthly", sampleperiod = 1, - lonmin = 0, lonmax = 360, latmin = -90, latmax = 90, - output = "areave", method = "conservative", grid = NULL, - maskmod = vector("list", 15), maskobs = vector("list", 15), - configfile = NULL, varmin = NULL, varmax = NULL, silent = FALSE, - nprocs = NULL, dimnames = NULL, remapcells = 2, - path_glob_permissive = "partial") +Load( + var, + exp = NULL, + obs = NULL, + sdates, + nmember = NULL, + nmemberobs = NULL, + nleadtime = NULL, + leadtimemin = 1, + leadtimemax = NULL, + storefreq = "monthly", + sampleperiod = 1, + lonmin = 0, + lonmax = 360, + latmin = -90, + latmax = 90, + output = "areave", + method = "conservative", + grid = NULL, + maskmod = vector("list", 15), + maskobs = vector("list", 15), + configfile = NULL, + varmin = NULL, + varmax = NULL, + silent = FALSE, + nprocs = NULL, + dimnames = NULL, + remapcells = 2, + path_glob_permissive = "partial" +) } \arguments{ \item{var}{Short name of the variable to load. It should coincide with the @@ -883,4 +904,3 @@ History:\cr 1.4 - 2016-01 (N. Manubens, \email{nicolau.manubens@bsc.es}) - Added subsetting capabilities } \keyword{datagen} - diff --git a/man/Mean1Dim.Rd b/man/Mean1Dim.Rd index 613fc468..6b45e1a7 100644 --- a/man/Mean1Dim.Rd +++ b/man/Mean1Dim.Rd @@ -36,4 +36,3 @@ History:\cr 1.0 - 2013-09 (N. Manubens, \email{nicolau.manubens@ic3.cat}) - Formatting to R CRAN } \keyword{datagen} - diff --git a/man/MeanListDim.Rd b/man/MeanListDim.Rd index 98e07c8e..2fdf8981 100644 --- a/man/MeanListDim.Rd +++ b/man/MeanListDim.Rd @@ -33,4 +33,3 @@ History:\cr 1.1 - 2015-03 (N. Manubens, \email{nicolau.manubens@ic3.cat}) - Improved memory usage } \keyword{datagen} - diff --git a/man/NAO.Rd b/man/NAO.Rd index 24d58830..34f36339 100644 --- a/man/NAO.Rd +++ b/man/NAO.Rd @@ -4,8 +4,14 @@ \alias{NAO} \title{Computes the North Atlantic Oscillation (NAO) Index} \usage{ -NAO(ano_exp = NULL, ano_obs = NULL, lon, lat, ftime_average = 2:4, - obsproj = TRUE) +NAO( + ano_exp = NULL, + ano_obs = NULL, + lon, + lat, + ftime_average = 2:4, + obsproj = TRUE +) } \arguments{ \item{ano_exp}{Array of North Atlantic SLP (20N-80N, 80W-40E) forecast @@ -113,6 +119,11 @@ PlotBoxWhisker(nao$NAO_exp, nao$NAO_obs, "NAO index, DJF", "NAO index (PC1) TOS" } } +\references{ +Doblas-Reyes, F.J., Pavan, V. and Stephenson, D. (2003). The skill of + multi-model seasonal forecasts of the wintertime North Atlantic Oscillation. + Climate Dynamics, 21, 501-514. DOI: 10.1007/s00382-003-0350-4 +} \author{ History:\cr 0.1 - 2013-08 (F. Lienert, \email{flienert@ic3.cat}) - Original code\cr @@ -127,10 +138,4 @@ History:\cr 1.0 - 2016-03 (N. Manubens, \email{nicolau.manubens@bsc.es}) - Formatted to CRAN } -\references{ -Doblas-Reyes, F.J., Pavan, V. and Stephenson, D. (2003). The skill of - multi-model seasonal forecasts of the wintertime North Atlantic Oscillation. - Climate Dynamics, 21, 501-514. DOI: 10.1007/s00382-003-0350-4 -} \keyword{datagen} - diff --git a/man/Plot2VarsVsLTime.Rd b/man/Plot2VarsVsLTime.Rd index 8ba44e4e..11af98a7 100644 --- a/man/Plot2VarsVsLTime.Rd +++ b/man/Plot2VarsVsLTime.Rd @@ -4,12 +4,30 @@ \alias{Plot2VarsVsLTime} \title{Plot Two Scores With Confidence Intervals In A Common Plot} \usage{ -Plot2VarsVsLTime(var1, var2, toptitle = "", ytitle = "", monini = 1, - freq = 12, nticks = NULL, limits = NULL, listexp = c("exp1", "exp2", - "exp3"), listvars = c("var1", "var2"), biglab = FALSE, hlines = NULL, - leg = TRUE, siglev = FALSE, sizetit = 1, show_conf = TRUE, - fileout = "output_plot2varsvsltime.eps", width = 8, height = 5, - size_units = "in", res = 100, ...) +Plot2VarsVsLTime( + var1, + var2, + toptitle = "", + ytitle = "", + monini = 1, + freq = 12, + nticks = NULL, + limits = NULL, + listexp = c("exp1", "exp2", "exp3"), + listvars = c("var1", "var2"), + biglab = FALSE, + hlines = NULL, + leg = TRUE, + siglev = FALSE, + sizetit = 1, + show_conf = TRUE, + fileout = "output_plot2varsvsltime.eps", + width = 8, + height = 5, + size_units = "in", + res = 100, + ... +) } \arguments{ \item{var1}{Matrix of dimensions (nexp/nmod, nltime).} @@ -120,4 +138,3 @@ History:\cr - Original code } \keyword{dynamic} - diff --git a/man/PlotACC.Rd b/man/PlotACC.Rd index fc66200a..289fbf17 100644 --- a/man/PlotACC.Rd +++ b/man/PlotACC.Rd @@ -4,11 +4,27 @@ \alias{PlotACC} \title{Plot Plumes/Timeseries Of Anomaly Correlation Coefficients} \usage{ -PlotACC(ACC, sdates, toptitle = "", sizetit = 1, ytitle = "", - limits = NULL, legends = NULL, freq = 12, biglab = FALSE, - fill = FALSE, linezero = FALSE, points = TRUE, vlines = NULL, - fileout = "output_PlotACC.eps", width = 8, height = 5, - size_units = "in", res = 100, ...) +PlotACC( + ACC, + sdates, + toptitle = "", + sizetit = 1, + ytitle = "", + limits = NULL, + legends = NULL, + freq = 12, + biglab = FALSE, + fill = FALSE, + linezero = FALSE, + points = TRUE, + vlines = NULL, + fileout = "output_PlotACC.eps", + width = 8, + height = 5, + size_units = "in", + res = 100, + ... +) } \arguments{ \item{ACC}{ACC matrix with with dimensions:\cr @@ -122,4 +138,3 @@ History:\cr 1.0 - 2013-09 (N. Manubens, \email{nicolau.manubens@ic3.cat}) - Formatting to CRAN } \keyword{dynamic} - diff --git a/man/PlotAno.Rd b/man/PlotAno.Rd index dd059310..2ff2c46c 100644 --- a/man/PlotAno.Rd +++ b/man/PlotAno.Rd @@ -4,12 +4,30 @@ \alias{PlotAno} \title{Plot Raw Or Smoothed Anomalies} \usage{ -PlotAno(exp_ano, obs_ano = NULL, sdates, toptitle = rep("", 15), - ytitle = rep("", 15), limits = NULL, legends = NULL, freq = 12, - biglab = FALSE, fill = TRUE, memb = TRUE, ensmean = TRUE, - linezero = FALSE, points = FALSE, vlines = NULL, sizetit = 1, - fileout = paste0("output", 1:5, "_plotano.eps"), width = 8, height = 5, - size_units = "in", res = 100, ...) +PlotAno( + exp_ano, + obs_ano = NULL, + sdates, + toptitle = rep("", 15), + ytitle = rep("", 15), + limits = NULL, + legends = NULL, + freq = 12, + biglab = FALSE, + fill = TRUE, + memb = TRUE, + ensmean = TRUE, + linezero = FALSE, + points = FALSE, + vlines = NULL, + sizetit = 1, + fileout = paste0("output", 1:5, "_plotano.eps"), + width = 8, + height = 5, + size_units = "in", + res = 100, + ... +) } \arguments{ \item{exp_ano}{Array containing the experimental data:\cr @@ -109,4 +127,3 @@ History:\cr 1.0 - 2013-09 (N. Manubens, \email{nicolau.manubens@ic3.cat}) - Formatting to CRAN } \keyword{dynamic} - diff --git a/man/PlotBoxWhisker.Rd b/man/PlotBoxWhisker.Rd index a536686b..9d602103 100644 --- a/man/PlotBoxWhisker.Rd +++ b/man/PlotBoxWhisker.Rd @@ -4,10 +4,24 @@ \alias{PlotBoxWhisker} \title{Box-And-Whisker Plot of Time Series with Ensemble Distribution} \usage{ -PlotBoxWhisker(exp, obs, toptitle = "", ytitle = "", monini = 1, - yearini = 0, freq = 1, expname = "exp 1", obsname = "obs 1", - drawleg = TRUE, fileout = "output_PlotBoxWhisker.ps", width = 8, - height = 5, size_units = "in", res = 100, ...) +PlotBoxWhisker( + exp, + obs, + toptitle = "", + ytitle = "", + monini = 1, + yearini = 0, + freq = 1, + expname = "exp 1", + obsname = "obs 1", + drawleg = TRUE, + fileout = "output_PlotBoxWhisker.ps", + width = 8, + height = 5, + size_units = "in", + res = 100, + ... +) } \arguments{ \item{exp}{Forecast array of multi-member time series, e.g., the NAO index @@ -119,6 +133,9 @@ PlotBoxWhisker(nao$NAO_exp, nao$NAO_obs, "NAO index, DJF", "NAO index (PC1) TOS" monini = 12, yearini = 1985, freq = 1, "Exp. A", "Obs. X") } +} +\seealso{ +EOF, ProjectField, NAO } \author{ History:\cr @@ -127,8 +144,4 @@ History:\cr normalization for sake of clarity. 1.0 - 2016-03 (N. Manubens, \email{nicolau.manubens@bsc.es}) - Formatting to R CRAN } -\seealso{ -EOF, ProjectField, NAO -} \keyword{datagen} - diff --git a/man/PlotClim.Rd b/man/PlotClim.Rd index 7ee001ee..f4fd7e1a 100644 --- a/man/PlotClim.Rd +++ b/man/PlotClim.Rd @@ -4,11 +4,26 @@ \alias{PlotClim} \title{Plots Climatologies} \usage{ -PlotClim(exp_clim, obs_clim = NULL, toptitle = "", ytitle = "", - monini = 1, freq = 12, limits = NULL, listexp = c("exp1", "exp2", - "exp3"), listobs = c("obs1", "obs2", "obs3"), biglab = FALSE, - leg = TRUE, sizetit = 1, fileout = "output_plotclim.eps", width = 8, - height = 5, size_units = "in", res = 100, ...) +PlotClim( + exp_clim, + obs_clim = NULL, + toptitle = "", + ytitle = "", + monini = 1, + freq = 12, + limits = NULL, + listexp = c("exp1", "exp2", "exp3"), + listobs = c("obs1", "obs2", "obs3"), + biglab = FALSE, + leg = TRUE, + sizetit = 1, + fileout = "output_plotclim.eps", + width = 8, + height = 5, + size_units = "in", + res = 100, + ... +) } \arguments{ \item{exp_clim}{Matrix containing the experimental data with dimensions:\cr @@ -87,4 +102,3 @@ History:\cr 1.0 - 2013-09 (N. Manubens, \email{nicolau.manubens@ic3.cat}) - Formatting to CRAN } \keyword{datagen} - diff --git a/man/PlotEquiMap.Rd b/man/PlotEquiMap.Rd index cb33fc60..c9db45b5 100644 --- a/man/PlotEquiMap.Rd +++ b/man/PlotEquiMap.Rd @@ -4,25 +4,72 @@ \alias{PlotEquiMap} \title{Maps A Two-Dimensional Variable On A Cylindrical Equidistant Projection} \usage{ -PlotEquiMap(var, lon, lat, varu = NULL, varv = NULL, toptitle = NULL, - sizetit = NULL, units = NULL, brks = NULL, cols = NULL, - bar_limits = NULL, triangle_ends = NULL, col_inf = NULL, - col_sup = NULL, colNA = NULL, color_fun = clim.palette(), - square = TRUE, filled.continents = NULL, coast_color = NULL, - coast_width = 1, contours = NULL, brks2 = NULL, contour_lwd = 0.5, - contour_color = "black", contour_lty = 1, contour_label_scale = 1, - dots = NULL, dot_symbol = 4, dot_size = 1, - arr_subsamp = floor(length(lon)/30), arr_scale = 1, arr_ref_len = 15, - arr_units = "m/s", arr_scale_shaft = 1, arr_scale_shaft_angle = 1, - axelab = TRUE, labW = FALSE, intylat = 20, intxlon = 20, - axes_tick_scale = 1, axes_label_scale = 1, drawleg = TRUE, - subsampleg = NULL, bar_extra_labels = NULL, draw_bar_ticks = TRUE, - draw_separators = FALSE, triangle_ends_scale = 1, bar_label_digits = 4, - bar_label_scale = 1, units_scale = 1, bar_tick_scale = 1, - bar_extra_margin = rep(0, 4), boxlim = NULL, boxcol = "purple2", - boxlwd = 5, margin_scale = rep(1, 4), title_scale = 1, numbfig = NULL, - fileout = NULL, width = 8, height = 5, size_units = "in", res = 100, - ...) +PlotEquiMap( + var, + lon, + lat, + varu = NULL, + varv = NULL, + toptitle = NULL, + sizetit = NULL, + units = NULL, + brks = NULL, + cols = NULL, + bar_limits = NULL, + triangle_ends = NULL, + col_inf = NULL, + col_sup = NULL, + colNA = NULL, + color_fun = clim.palette(), + square = TRUE, + filled.continents = NULL, + coast_color = NULL, + coast_width = 1, + contours = NULL, + brks2 = NULL, + contour_lwd = 0.5, + contour_color = "black", + contour_lty = 1, + contour_label_scale = 1, + dots = NULL, + dot_symbol = 4, + dot_size = 1, + arr_subsamp = floor(length(lon)/30), + arr_scale = 1, + arr_ref_len = 15, + arr_units = "m/s", + arr_scale_shaft = 1, + arr_scale_shaft_angle = 1, + axelab = TRUE, + labW = FALSE, + intylat = 20, + intxlon = 20, + axes_tick_scale = 1, + axes_label_scale = 1, + drawleg = TRUE, + subsampleg = NULL, + bar_extra_labels = NULL, + draw_bar_ticks = TRUE, + draw_separators = FALSE, + triangle_ends_scale = 1, + bar_label_digits = 4, + bar_label_scale = 1, + units_scale = 1, + bar_tick_scale = 1, + bar_extra_margin = rep(0, 4), + boxlim = NULL, + boxcol = "purple2", + boxlwd = 5, + margin_scale = rep(1, 4), + title_scale = 1, + numbfig = NULL, + fileout = NULL, + width = 8, + height = 5, + size_units = "in", + res = 100, + ... +) } \arguments{ \item{var}{Array with the values at each cell of a grid on a regular @@ -288,4 +335,3 @@ History:\cr and adapted to new ColorBar. } \keyword{dynamic} - diff --git a/man/PlotLayout.Rd b/man/PlotLayout.Rd index e4cf4ecf..3cb81d15 100644 --- a/man/PlotLayout.Rd +++ b/man/PlotLayout.Rd @@ -4,20 +4,52 @@ \alias{PlotLayout} \title{Arrange and Fill Multi-Pannel Layouts With Optional Colour Bar} \usage{ -PlotLayout(fun, plot_dims, var, ..., special_args = NULL, nrow = NULL, - ncol = NULL, toptitle = NULL, row_titles = NULL, col_titles = NULL, - bar_scale = 1, title_scale = 1, title_margin_scale = 1, - title_left_shift_scale = 1, subtitle_scale = 1, - subtitle_margin_scale = 1, brks = NULL, cols = NULL, drawleg = "S", - titles = NULL, subsampleg = NULL, bar_limits = NULL, - triangle_ends = NULL, col_inf = NULL, col_sup = NULL, - color_fun = clim.colors, draw_bar_ticks = TRUE, draw_separators = FALSE, - triangle_ends_scale = 1, bar_extra_labels = NULL, units = NULL, - units_scale = 1, bar_label_scale = 1, bar_tick_scale = 1, - bar_extra_margin = rep(0, 4), bar_left_shift_scale = 1, - bar_label_digits = 4, extra_margin = rep(0, 4), fileout = NULL, - width = NULL, height = NULL, size_units = "in", res = 100, - close_device = TRUE) +PlotLayout( + fun, + plot_dims, + var, + ..., + special_args = NULL, + nrow = NULL, + ncol = NULL, + toptitle = NULL, + row_titles = NULL, + col_titles = NULL, + bar_scale = 1, + title_scale = 1, + title_margin_scale = 1, + title_left_shift_scale = 1, + subtitle_scale = 1, + subtitle_margin_scale = 1, + brks = NULL, + cols = NULL, + drawleg = "S", + titles = NULL, + subsampleg = NULL, + bar_limits = NULL, + triangle_ends = NULL, + col_inf = NULL, + col_sup = NULL, + color_fun = clim.colors, + draw_bar_ticks = TRUE, + draw_separators = FALSE, + triangle_ends_scale = 1, + bar_extra_labels = NULL, + units = NULL, + units_scale = 1, + bar_label_scale = 1, + bar_tick_scale = 1, + bar_extra_margin = rep(0, 4), + bar_left_shift_scale = 1, + bar_label_digits = 4, + extra_margin = rep(0, 4), + fileout = NULL, + width = NULL, + height = NULL, + size_units = "in", + res = 100, + close_device = TRUE +) } \arguments{ \item{fun}{Plot function (or name of the function) to be called on the @@ -48,6 +80,12 @@ applied to each of them. NAs can be passed to the list: a NA will yield a blank cell in the layout, which can be populated after (see .SwitchToFigure).} +\item{\dots}{Parameters to be sent to the plotting function 'fun'. If +multiple arrays are provided in 'var' and multiple functions are provided +in 'fun', the parameters provided through \dots will be sent to all the +plot functions, as common parameters. To specify concrete arguments for +each of the plot functions see parameter 'special_args'.} + \item{special_args}{List of sub-lists, each sub-list having specific extra arguments for each of the plot functions provided in 'fun'. If you want to fix a different value for each plot in the layout you can do so by @@ -164,12 +202,6 @@ the layout and a 'fileout' has been specified. This is useful to avoid closing the device when saving the layout into a file and willing to add extra elements or figures. Takes TRUE by default. Disregarded if no 'fileout' has been specified.} - -\item{\dots}{Parameters to be sent to the plotting function 'fun'. If -multiple arrays are provided in 'var' and multiple functions are provided -in 'fun', the parameters provided through \dots will be sent to all the -plot functions, as common parameters. To specify concrete arguments for -each of the plot functions see parameter 'special_args'.} } \value{ \item{brks}{ @@ -249,4 +281,3 @@ History:\cr 0.1 - 2016-08 (N. Manubens, \email{nicolau.manubens@bsc.es}) - Original code } \keyword{dynamic} - diff --git a/man/PlotMatrix.Rd b/man/PlotMatrix.Rd index 70c1211e..88458856 100644 --- a/man/PlotMatrix.Rd +++ b/man/PlotMatrix.Rd @@ -4,12 +4,28 @@ \alias{PlotMatrix} \title{Function to convert any numerical table to a grid of coloured squares.} \usage{ -PlotMatrix(var, brks = NULL, cols = NULL, toptitle = NULL, - title.color = "royalblue4", xtitle = NULL, ytitle = NULL, - xlabels = NULL, xvert = FALSE, ylabels = NULL, line = 3, - figure.width = 1, legend = TRUE, legend.width = 0.15, - xlab_dist = NULL, ylab_dist = NULL, fileout = NULL, size_units = "px", - res = 100, ...) +PlotMatrix( + var, + brks = NULL, + cols = NULL, + toptitle = NULL, + title.color = "royalblue4", + xtitle = NULL, + ytitle = NULL, + xlabels = NULL, + xvert = FALSE, + ylabels = NULL, + line = 3, + figure.width = 1, + legend = TRUE, + legend.width = 0.15, + xlab_dist = NULL, + ylab_dist = NULL, + fileout = NULL, + size_units = "px", + res = 100, + ... +) } \arguments{ \item{var}{A numerical matrix containing the values to be displayed in a @@ -93,4 +109,3 @@ PlotMatrix(var = matrix(rnorm(n = 120, mean = 0.3), 10, 12), xlabels = c("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec")) } - diff --git a/man/PlotSection.Rd b/man/PlotSection.Rd index f7447319..3dbe4fa1 100644 --- a/man/PlotSection.Rd +++ b/man/PlotSection.Rd @@ -4,10 +4,26 @@ \alias{PlotSection} \title{Plots A Vertical Section} \usage{ -PlotSection(var, horiz, depth, toptitle = "", sizetit = 1, units = "", - brks = NULL, cols = NULL, axelab = TRUE, intydep = 200, - intxhoriz = 20, drawleg = TRUE, fileout = NULL, width = 8, - height = 5, size_units = "in", res = 100, ...) +PlotSection( + var, + horiz, + depth, + toptitle = "", + sizetit = 1, + units = "", + brks = NULL, + cols = NULL, + axelab = TRUE, + intydep = 200, + intxhoriz = 20, + drawleg = TRUE, + fileout = NULL, + width = 8, + height = 5, + size_units = "in", + res = 100, + ... +) } \arguments{ \item{var}{Matrix to plot with (longitude/latitude, depth) dimensions.} @@ -75,4 +91,3 @@ History:\cr 1.0 - 2013-09 (N. Manubens, \email{nicolau.manubens@ic3.cat}) - Formatting to CRAN } \keyword{dynamic} - diff --git a/man/PlotVsLTime.Rd b/man/PlotVsLTime.Rd index 2c71e9fa..402414d1 100644 --- a/man/PlotVsLTime.Rd +++ b/man/PlotVsLTime.Rd @@ -4,12 +4,29 @@ \alias{PlotVsLTime} \title{Plots A Score Along The Forecast Time With Its Confidence Interval} \usage{ -PlotVsLTime(var, toptitle = "", ytitle = "", monini = 1, freq = 12, - nticks = NULL, limits = NULL, listexp = c("exp1", "exp2", "exp3"), - listobs = c("obs1", "obs2", "obs3"), biglab = FALSE, hlines = NULL, - leg = TRUE, siglev = FALSE, sizetit = 1, show_conf = TRUE, - fileout = "output_plotvsltime.eps", width = 8, height = 5, - size_units = "in", res = 100, ...) +PlotVsLTime( + var, + toptitle = "", + ytitle = "", + monini = 1, + freq = 12, + nticks = NULL, + limits = NULL, + listexp = c("exp1", "exp2", "exp3"), + listobs = c("obs1", "obs2", "obs3"), + biglab = FALSE, + hlines = NULL, + leg = TRUE, + siglev = FALSE, + sizetit = 1, + show_conf = TRUE, + fileout = "output_plotvsltime.eps", + width = 8, + height = 5, + size_units = "in", + res = 100, + ... +) } \arguments{ \item{var}{Matrix containing any Prediction Score with dimensions:\cr @@ -133,4 +150,3 @@ History:\cr 1.0 - 2013-11 (N. Manubens, \email{nicolau.manubens@ic3.cat}) - Formatting to CRAN } \keyword{dynamic} - diff --git a/man/ProbBins.Rd b/man/ProbBins.Rd index 6df49cc2..56cf0511 100644 --- a/man/ProbBins.Rd +++ b/man/ProbBins.Rd @@ -4,8 +4,15 @@ \alias{ProbBins} \title{Computes Probabilistic Information of a Forecast Relative to a Threshold or a Quantile} \usage{ -ProbBins(ano, fcyr = "all", thr, quantile = TRUE, posdates = 3, - posdim = 2, compPeriod = "Full period") +ProbBins( + ano, + fcyr = "all", + thr, + quantile = TRUE, + posdates = 3, + posdim = 2, + compPeriod = "Full period" +) } \arguments{ \item{ano}{Array of anomalies from Ano().\cr @@ -86,4 +93,3 @@ History:\cr 2.1 - 2017-02 (V. Torralba and N. Manubens, \email{veronica.torralba@bsc.es}) - Fix bug with cross-validation } \keyword{datagen} - diff --git a/man/ProjectField.Rd b/man/ProjectField.Rd index 7b2e9e93..7dd77123 100644 --- a/man/ProjectField.Rd +++ b/man/ProjectField.Rd @@ -74,6 +74,9 @@ for (i in 1:dim(sampleData$mod)[2]) { ylim = c(-15000, 15000)) } +} +\seealso{ +EOF, NAO, PlotBoxWhisker } \author{ History:\cr @@ -105,8 +108,4 @@ multiplied by W. Getting input dimensions. 1.0 - 2016-03 (N. Manubens, \email{nicolau.manubens@bsc.es}) - Formatting to R CRAN\cr (J.-P. Baudouin, \email{jean.baudouin@bsc.es}) - Example code and testing } -\seealso{ -EOF, NAO, PlotBoxWhisker -} \keyword{datagen} - diff --git a/man/RMS.Rd b/man/RMS.Rd index 715f84d1..877300fa 100644 --- a/man/RMS.Rd +++ b/man/RMS.Rd @@ -1,12 +1,20 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/RMS.R \name{RMS} -\alias{.RMS} \alias{RMS} +\alias{.RMS} \title{Computes Root Mean Square Error} \usage{ -RMS(var_exp, var_obs, posloop = 1, posRMS = 2, compROW = NULL, - limits = NULL, siglev = 0.95, conf = TRUE) +RMS( + var_exp, + var_obs, + posloop = 1, + posRMS = 2, + compROW = NULL, + limits = NULL, + siglev = 0.95, + conf = TRUE +) .RMS(exp, obs, siglev = 0.95, conf = TRUE) } @@ -119,4 +127,3 @@ History:\cr 1.1 - 2017-02 (A. Hunter, \email{alasdair.hunter@bsc.es}) - Adapted to veriApply() } \keyword{datagen} - diff --git a/man/RMSSS.Rd b/man/RMSSS.Rd index f602702b..8bc0d803 100644 --- a/man/RMSSS.Rd +++ b/man/RMSSS.Rd @@ -1,8 +1,8 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/RMSSS.R \name{RMSSS} -\alias{.RMSSS} \alias{RMSSS} +\alias{.RMSSS} \title{Computes Root Mean Square Skill Score} \usage{ RMSSS(var_exp, var_obs, posloop = 1, posRMS = 2, pval = TRUE) @@ -93,4 +93,3 @@ History:\cr 1.1 - 2017-02 (A. Hunter, \email{alasdair.hunter@bsc.es}) - Adapted to veriApply() } \keyword{datagen} - diff --git a/man/RatioRMS.Rd b/man/RatioRMS.Rd index 44d13dbb..b1abbca1 100644 --- a/man/RatioRMS.Rd +++ b/man/RatioRMS.Rd @@ -1,8 +1,8 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/RatioRMS.R \name{RatioRMS} -\alias{.RatioRMS} \alias{RatioRMS} +\alias{.RatioRMS} \title{Computes the Ratio Between The RMSE of Two Experiments} \usage{ RatioRMS(var_exp1, var_exp2, var_obs, posRMS = 1, pval = TRUE) @@ -121,4 +121,3 @@ History:\cr 1.1 - 2017-02 (A. Hunter, \email{alasdair.hunter@bsc.es}) - Adapted to veriApply() } \keyword{datagen} - diff --git a/man/RatioSDRMS.Rd b/man/RatioSDRMS.Rd index 09484740..97efe6da 100644 --- a/man/RatioSDRMS.Rd +++ b/man/RatioSDRMS.Rd @@ -1,8 +1,8 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/RatioSDRMS.R \name{RatioSDRMS} -\alias{.RatioSDRMS} \alias{RatioSDRMS} +\alias{.RatioSDRMS} \title{Computes the ratio between the ensemble spread and RMSE} \usage{ RatioSDRMS(var_exp, var_obs, pval = TRUE) @@ -86,4 +86,3 @@ History:\cr 1.1 - 2017-02 (A. Hunter, \email{alasdair.hunter@bsc.es}) - Adapted to veriApply() } \keyword{datagen} - diff --git a/man/Regression.Rd b/man/Regression.Rd index 55646576..a3763150 100644 --- a/man/Regression.Rd +++ b/man/Regression.Rd @@ -73,4 +73,3 @@ History:\cr 1.0 - 2013-09 (N. Manubens, \email{nicolau.manubens@ic3.cat}) - Formatting to CRAN } \keyword{datagen} - diff --git a/man/SVD.Rd b/man/SVD.Rd index 698df952..bbbcaa49 100644 --- a/man/SVD.Rd +++ b/man/SVD.Rd @@ -4,8 +4,15 @@ \alias{SVD} \title{Single Value Decomposition (Maximum Covariance Analysis)} \usage{ -SVD(vary, varx, laty = NULL, latx = NULL, nmodes = 15, corr = FALSE, - weight = TRUE) +SVD( + vary, + varx, + laty = NULL, + latx = NULL, + nmodes = 15, + corr = FALSE, + weight = TRUE +) } \arguments{ \item{vary}{Array containing the anomalies field for the predictor. The @@ -117,4 +124,3 @@ History:\cr 1.0 - 2016-04 (N. Manubens, \email{nicolau.manubens@bsc.es}) - Formatting to R CRAN } \keyword{datagen} - diff --git a/man/Season.Rd b/man/Season.Rd index cc97941c..76f64053 100644 --- a/man/Season.Rd +++ b/man/Season.Rd @@ -54,4 +54,3 @@ History:\cr 1.0 - 2013-09 (N. Manubens, \email{nicolau.manubens@ic3.cat}) - Formatting to CRAN } \keyword{datagen} - diff --git a/man/SelIndices.Rd b/man/SelIndices.Rd index dbf34da2..ab3ca88e 100644 --- a/man/SelIndices.Rd +++ b/man/SelIndices.Rd @@ -37,4 +37,3 @@ History:\cr 1.0 - 2013-09 (N. Manubens, \email{nicolau.manubens@ic3.cat}) - Formatting to CRAN } \keyword{datagen} - diff --git a/man/Smoothing.Rd b/man/Smoothing.Rd index 4fa9c596..492370e9 100644 --- a/man/Smoothing.Rd +++ b/man/Smoothing.Rd @@ -47,4 +47,3 @@ History:\cr making it able to work on arrays of any number of dimensions. } \keyword{datagen} - diff --git a/man/Spectrum.Rd b/man/Spectrum.Rd index de5a2e5e..a3fce568 100644 --- a/man/Spectrum.Rd +++ b/man/Spectrum.Rd @@ -48,4 +48,3 @@ History:\cr 1.0 - 2013-09 (N. Manubens, \email{nicolau.manubens@ic3.cat}) - Formatting to CRAN } \keyword{datagen} - diff --git a/man/Spread.Rd b/man/Spread.Rd index f84cecf3..a9f3125b 100644 --- a/man/Spread.Rd +++ b/man/Spread.Rd @@ -93,4 +93,3 @@ History:\cr 1.0 - 2013-09 (N. Manubens, \email{nicolau.manubens@ic3.cat}) - Formatting to CRAN } \keyword{datagen} - diff --git a/man/StatSeasAtlHurr.Rd b/man/StatSeasAtlHurr.Rd index 9822eb90..053698f7 100644 --- a/man/StatSeasAtlHurr.Rd +++ b/man/StatSeasAtlHurr.Rd @@ -66,10 +66,6 @@ hr_count <- StatSeasAtlHurr(atlano = AtlAno, hrvar = 'HR') print(hr_count$mean) -} -\author{ -History:\cr -0.1 - 2015-11 (Louis-Philippe Caron, \email{louis-philippe.caron@bsc.es}) - Original code } \references{ Villarini et al. (2010) Mon Wea Rev, 138, 2681-2705.\cr @@ -81,5 +77,8 @@ Caron, L.-P. et al. (2014) Multi-year prediction skill of Atlantic hurricane activity in CMIP5 decadal hindcasts. Climate Dynamics, 42, 2675-2690. doi:10.1007/s00382-013-1773-1. } +\author{ +History:\cr +0.1 - 2015-11 (Louis-Philippe Caron, \email{louis-philippe.caron@bsc.es}) - Original code +} \keyword{datagen} - diff --git a/man/Subset.Rd b/man/Subset.Rd index bccec4ac..570cd732 100644 --- a/man/Subset.Rd +++ b/man/Subset.Rd @@ -45,4 +45,3 @@ PlotLayout(PlotEquiMap, c('lat', 'lon'), subset, } \keyword{datagen} - diff --git a/man/ToyModel.Rd b/man/ToyModel.Rd index ca47b449..5eee0393 100644 --- a/man/ToyModel.Rd +++ b/man/ToyModel.Rd @@ -7,8 +7,18 @@ components of a forecast: (1) predictabiltiy (2) forecast error (3) non-stationarity and (4) ensemble generation. The forecast can be computed for real observations or observations generated artifically.} \usage{ -ToyModel(alpha = 0.1, beta = 0.4, gamma = 1, sig = 1, trend = 0, - nstartd = 30, nleadt = 4, nmemb = 10, obsini = NULL, fxerr = NULL) +ToyModel( + alpha = 0.1, + beta = 0.4, + gamma = 1, + sig = 1, + trend = 0, + nstartd = 30, + nleadt = 4, + nmemb = 10, + obsini = NULL, + fxerr = NULL +) } \arguments{ \item{alpha}{Predicabiltiy of the forecast on the observed residuals @@ -125,4 +135,3 @@ History:\cr 1.1 - 2016-02 (O.Bellprat) - Include security check for parameters } \keyword{datagen} - diff --git a/man/Trend.Rd b/man/Trend.Rd index 3b7f7bfd..b4e0ba36 100644 --- a/man/Trend.Rd +++ b/man/Trend.Rd @@ -1,8 +1,8 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/Trend.R \name{Trend} -\alias{.Trend} \alias{Trend} +\alias{.Trend} \title{Computes the Trend of the Ensemble Mean} \usage{ Trend(var, posTR = 2, interval = 1, siglev = 0.95, conf = TRUE) @@ -78,4 +78,3 @@ History:\cr 2.0 - 2017-02 (A. Hunter, \email{alasdair.hunter@bsc.es}) - Adapt to veriApply() } \keyword{datagen} - diff --git a/man/UltimateBrier.Rd b/man/UltimateBrier.Rd index 46fe124c..518a60cc 100644 --- a/man/UltimateBrier.Rd +++ b/man/UltimateBrier.Rd @@ -4,9 +4,17 @@ \alias{UltimateBrier} \title{Computes Brier Scores} \usage{ -UltimateBrier(ano_exp, ano_obs, posdatasets = 1, posmemb = 2, - posdates = 3, quantile = TRUE, thr = c(5/100, 95/100), type = "BS", - decomposition = TRUE) +UltimateBrier( + ano_exp, + ano_obs, + posdatasets = 1, + posmemb = 2, + posdates = 3, + quantile = TRUE, + thr = c(5/100, 95/100), + type = "BS", + decomposition = TRUE +) } \arguments{ \item{ano_exp}{Array of forecast anomalies, as provided by \code{Ano()}. @@ -124,4 +132,3 @@ History:\cr N. Manubens, \email{nicolau.manubens@bsc.es}) - First version } \keyword{datagen} - diff --git a/man/clim.palette.Rd b/man/clim.palette.Rd index 95f8407c..e67994f8 100644 --- a/man/clim.palette.Rd +++ b/man/clim.palette.Rd @@ -1,8 +1,8 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/clim.palette.R \name{clim.palette} -\alias{clim.colors} \alias{clim.palette} +\alias{clim.colors} \title{Generate Climate Color Palettes} \usage{ clim.palette(palette = "bluered") @@ -35,4 +35,3 @@ History:\cr 0.0 - 2016-01 (N. Manubens, \email{nicolau.manubens@bsc.es}) - Original code. } \keyword{datagen} - diff --git a/man/s2dverification.Rd b/man/s2dverification.Rd index 47acf220..415c4896 100644 --- a/man/s2dverification.Rd +++ b/man/s2dverification.Rd @@ -26,6 +26,14 @@ Check an overview of the package functionalities and its modules at \url{https://earth.bsc.es/gitlab/es/s2dverification/-/wikis/home}. For more information load the package and check the help for each function or the documentation attached to the package. +} +\seealso{ +Useful links: +\itemize{ + \item \url{https://earth.bsc.es/gitlab/es/s2dverification/-/wikis/home} + \item Report bugs at \url{https://earth.bsc.es/gitlab/es/s2dverification/-/issues} +} + } \author{ Nicolau Manubens \email{nicolau.manubens@bsc.es} @@ -33,4 +41,3 @@ Nicolau Manubens \email{nicolau.manubens@bsc.es} \keyword{datagen} \keyword{dynamic} \keyword{package} - diff --git a/man/sampleDepthData.Rd b/man/sampleDepthData.Rd index 974fe6bd..3292f5c6 100644 --- a/man/sampleDepthData.Rd +++ b/man/sampleDepthData.Rd @@ -32,4 +32,3 @@ Its name within IC3 local database is 'i00k'. Nicolau Manubens \email{nicolau.manubens@bsc.es} } \keyword{data} - diff --git a/man/sampleMap.Rd b/man/sampleMap.Rd index d33ab829..7286b8a6 100644 --- a/man/sampleMap.Rd +++ b/man/sampleMap.Rd @@ -47,4 +47,3 @@ Check the documentation on 'Load()' in the package 's2dverification' for more in Nicolau Manubens \email{nicolau.manubens@bsc.es} } \keyword{datasets} - diff --git a/man/sampleTimeSeries.Rd b/man/sampleTimeSeries.Rd index ce2c6395..4871a928 100644 --- a/man/sampleTimeSeries.Rd +++ b/man/sampleTimeSeries.Rd @@ -51,4 +51,3 @@ Check the documentation on 'Load()' in the package 's2dverification' for more in Nicolau Manubens \email{nicolau.manubens@bsc.es} } \keyword{datasets} - -- GitLab From 51b7dd40cd80059c1096bdddfee823a0df778855 Mon Sep 17 00:00:00 2001 From: aho Date: Thu, 3 Jun 2021 20:18:59 +0200 Subject: [PATCH 4/6] Fix InsertDim() argument --- R/PlotStereoMap.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/PlotStereoMap.R b/R/PlotStereoMap.R index 219956cd..cde09859 100644 --- a/R/PlotStereoMap.R +++ b/R/PlotStereoMap.R @@ -776,8 +776,8 @@ PlotStereoMap <- function(var, lon, lat, varu = NULL, varv = NULL, latlims = c(6 # if (!is.null(varu) && !is.null(varv)) { # Create a two dimention array of longitude and latitude - lontab <- InsertDim(lonb$x, 2, length(latb$x[latb_plot_ind]), name = 'lat') - lattab <- InsertDim(latb$x[latb_plot_ind], 1, length(lonb$x), name = 'lon') + lontab <- InsertDim(lonb$x, 2, length(latb$x[latb_plot_ind])) + lattab <- InsertDim(latb$x[latb_plot_ind], 1, length(lonb$x)) # Select a subsample of the points to an arrow for each "subsample" grid point # latmin has the most arrows, and latmax (polar point) has no arrow. sublon_max <- seq(1, length(lonb$x), arr_subsamp) -- GitLab From 4bb4ac0a4a278d370118ebe23a72de04d56f2ee0 Mon Sep 17 00:00:00 2001 From: aho Date: Thu, 3 Jun 2021 20:19:07 +0200 Subject: [PATCH 5/6] Fix example --- R/Cluster.R | 2 +- man/Cluster.Rd | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/R/Cluster.R b/R/Cluster.R index da9c62a6..1dc0b825 100644 --- a/R/Cluster.R +++ b/R/Cluster.R @@ -85,7 +85,7 @@ #' a1[i1, ] <- x1 + rnorm(4, mean = mean1, sd = sd1) #'} #' -#'c1p5 <- c0[!(c0 \%in\% c1)] +#'c1p5 <- c0[!(c0 %in% c1)] #'c2 <- c1p5[seq(1, length(c1p5), 2)] #'x2 <- c(2, 2, 4, 4) #'for (i2 in c2) { diff --git a/man/Cluster.Rd b/man/Cluster.Rd index 782c37a4..4094fcb8 100644 --- a/man/Cluster.Rd +++ b/man/Cluster.Rd @@ -92,7 +92,7 @@ for (i1 in c1) { a1[i1, ] <- x1 + rnorm(4, mean = mean1, sd = sd1) } -c1p5 <- c0[!(c0 \\%in\\% c1)] +c1p5 <- c0[!(c0 \%in\% c1)] c2 <- c1p5[seq(1, length(c1p5), 2)] x2 <- c(2, 2, 4, 4) for (i2 in c2) { -- GitLab From 561ea929aae27a861b8076b113b221eb0d4babf4 Mon Sep 17 00:00:00 2001 From: aho Date: Thu, 3 Jun 2021 20:29:21 +0200 Subject: [PATCH 6/6] Fix border problem. The border grids were cut as half before. --- R/PlotEquiMap.R | 39 +++++++++++++++++++++++++++++++++++---- 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/R/PlotEquiMap.R b/R/PlotEquiMap.R index 8f3fcb9a..c0fa89db 100644 --- a/R/PlotEquiMap.R +++ b/R/PlotEquiMap.R @@ -703,8 +703,23 @@ PlotEquiMap <- function(var, lon, lat, varu = NULL, varv = NULL, par(userArgs) par(mar = margins, cex.main = cex_title, cex.axis = cex_axes_labels, mgp = c(0, spaceticklab, 0), las = 0) - plot.window(xlim = range(lonb$x, finite = TRUE), ylim = range(latb$x, finite = TRUE), - xaxs = 'i', yaxs = 'i') + + #NOTE: Here creates the window for later plot. If 'usr' for par() is not specified, + # use the lat/lon as the borders. If 'usr' is specified, use the assigned values. + if (is.null(userArgs$usr)) { + #NOTE: The grids are assumed to be equally spaced + xlim_cal <- c(lonb$x[1] - (lonb$x[2] - lonb$x[1]) / 2, + lonb$x[length(lonb$x)] + (lonb$x[2] - lonb$x[1]) / 2) + ylim_cal <- c(latb$x[1] - (latb$x[2] - latb$x[1]) / 2, + latb$x[length(latb$x)] + (latb$x[2] - latb$x[1]) / 2) + plot.window(xlim = xlim_cal, ylim = ylim_cal, xaxs = 'i', yaxs = 'i') +# Below is Old code. The border grids are only half plotted. +# plot.window(xlim = range(lonb$x, finite = TRUE), ylim = range(latb$x, finite = TRUE), +# xaxs = 'i', yaxs = 'i') + } else { + plot.window(xlim = par("usr")[1:2], ylim = par("usr")[3:4], xaxs = 'i', yaxs = 'i') + } + if (axelab) { axis(2, at = ypos, labels = ylabs, cex.axis = cex_axes_labels, tcl = cex_axes_ticks, mgp = c(0, spaceticklab + 0.2, 0)) @@ -725,9 +740,15 @@ PlotEquiMap <- function(var, lon, lat, varu = NULL, varv = NULL, col = c(col_inf_image, cols, col_sup_image)) } if (!is.null(contours)) { +#NOTE: 'labcex' is the absolute size of contour labels. Parameter 'contour_label_scale' +# is provided in PlotEquiMap() but it was not used. Here, 'cex_axes_labels' was used +# and it was calculated from 'axes_label_scale', the size of lat/lon axis label. +# It is changed to use contour_label_scale*par('cex'). contour(lonb$x, latb$x, contours[lonb$ix, latb$ix], levels = brks2, - method = "edge", add = TRUE, - labcex = cex_axes_labels, lwd = contour_lwd, lty = contour_lty, + method = "edge", add = TRUE, +# labcex = cex_axes_labels, + labcex = contour_label_scale * par("cex"), + lwd = contour_lwd, lty = contour_lty, col = contour_color) } @@ -749,7 +770,17 @@ PlotEquiMap <- function(var, lon, lat, varu = NULL, varv = NULL, # Plotting continents # ~~~~~~~~~~~~~~~~~~~~~ # + # maps::map has the global map range [0, 360] or [-180, 180]. + # Set xlim so lon = 0 won't show a straight line when lon = [0, 359]. + # NOTE: It works except Antartic area. Don't know why. ylim is also set + # but it doesn't work. + if (continents == 'world') { # [-180, 180] + xlim_conti <- c(-179.99, 179.99) + } else { # [0, 360] + xlim_conti <- c(0.01, 359.99) + } coast <- map(continents, interior = FALSE, wrap = TRUE, + xlim = xlim_conti, ylim = c(-89.99, 89.99), fill = filled.continents, add = TRUE, plot = FALSE) if (filled.continents) { old_lwd <- par('lwd') -- GitLab