dev-subs_vis: plot_metrics() crashes when 'multi_panel = FALSE'
Hi,
This is to document the issue I am encountering while developing the subseasonal functionality in plot_metrics.R
. The problem is observed in the merge request !134 on the dev-subs_vis branch. I am using a Workstation.
I am using this data from the merge request:
source("modules/Loading/Loading.R")
source("modules/Saving/Saving.R") # to load function get_dir
source("modules/Visualization/Visualization.R")
datos <- readRDS("/esarchive/scratch/ptrascas/R/ptrascas_scripts/subseasonal_vis/subseasonal_test.RDS")
datos[[1]]$Run$code_dir <- "/esarchive/scratch/abatalla/git/sunset5/"
datos[[1]]$Run$output_dir <- "/esarchive/scratch/abatalla/outputs_abatalla/subseasonal/out0704-dev-rs/"
datos[[1]]$Run$logger <- log4r::logger(threshold = datos[[1]]$Run$Loglevel,
appenders = list(console_appender(layout = default_log_layout()),
file_appender("/esarchive/scratch/abatalla/test.log",
append = TRUE,
layout = default_log_layout())))
datos[[1]]$Analysis$Workflow$Visualization$file_format <- 'PNG'
datos[[1]]$Analysis$Workflow$Visualization$multi_panel <- FALSE
Visualization(recipe = datos[[1]], data = datos[[2]], skill_metrics = datos[[3]], significance = TRUE)
When datos[[1]]$Analysis$Workflow$Visualization$multi_panel <- TRUE
the output is as expected. When I set multi_panel
to FALSE
first I got this error. Changing the code in plot_metrics.R
from:
plot_metrics <- function(...) { ...
if (identical(fun, PlotRobinson)) {
## TODO: Customize alpha and other technical details depending on the metric
base_args[['caption']] <-
paste0("Nominal start date: ",
str_to_title(week), "\n",
"Forecast week: ", forecast_time, "\n", ## This is specific for subseasonal, would need a loop to specify time horizon
"Reference: ", recipe$Analysis$Datasets$Reference, "\n",
significance_caption)
}
...
}
to:
plot_metrics <- function(...) { ...
if (identical(fun, PlotRobinson)) {
## TODO: Customize alpha and other technical details depending on the metric
base_args[['caption']] <-
paste0("test", "\n",
"this is a test")
}
...
}
Leads to a crash, both in RStudio and in the terminal. This is the traceback message that appears on the terminal:
> Visualization(recipe = datos[[1]], data = datos[[2]], skill_metrics = datos[[3]], significance = TRUE)
INFO [2024-07-04 15:51:08] Plotting RPSS
*** caught segfault ***
address 0x19101fa9d9, cause 'memory not mapped'
Traceback:
1: CPL_geos_op("polygonize", x, numeric(0), integer(0), numeric(0), logical(0))
2: st_sfc(CPL_geos_op("polygonize", x, numeric(0), integer(0), numeric(0), logical(0)))
3: st_polygonize.sfc(box[1])
4: st_polygonize(box[1])
5: st_crs(y)
6: stopifnot(st_crs(x) == st_crs(y))
7: geos_op2_geom("intersection", x, y, ...)
8: geos_op2_df(x, y, geos_op2_geom("intersection", x, y, ...))
9: st_intersection.sf(df, st_polygonize(box[1]))
10: st_intersection(df, st_polygonize(box[1]))
11: withCallingHandlers(expr, message = function(c) if (inherits(c, classes)) tryInvokeRestart("muffleMessage"))
12: suppressMessages(st_intersection(df, st_polygonize(box[1])))
13: sf::st_graticule(bbox, crs = params$crs, lat = scale_y$breaks %|W|% NULL, lon = scale_x$breaks %|W|% NULL, datum = self$datum, ndiscr = self$ndiscr)
14: f(..., self = self)
15: self$coord$setup_panel_params(scale_x, scale_y, params = self$coord_params)
16: (function (scale_x, scale_y) { self$coord$setup_panel_params(scale_x, scale_y, params = self$coord_params)})(dots[[1L]][[1L]], dots[[2L]][[1L]])
17: mapply(FUN = f, ..., SIMPLIFY = FALSE)
18: Map(setup_panel_params, scales_x, scales_y)
19: f(..., self = self)
20: layout$setup_panel_params()
21: ggplot_build.ggplot(x)
22: ggplot_build(x)
23: ggplot_gtable(ggplot_build(x))
24: ggplot2::ggplotGrob(plot)
25: as_grob.ggplot(plot)
26: as_grob(plot)
27: as_gtable.default(x)
28: as_gtable(x)
29: FUN(X[[i]], ...)
30: lapply(plots, function(x) { if (!is.null(x)) as_gtable(x) else NULL})
31: align_plots(plotlist = plots, align = align, axis = axis, greedy = greedy)
32: cowplot::plot_grid(res_p, fun_legend, rel_widths = c(6, 1))
33: (function (data, lon, lat, lon_dim = NULL, lat_dim = NULL, target_proj = 54030, legend = "s2dv", style = "point", dots = NULL, mask = NULL, brks = NULL, cols = NULL, bar_limits = NULL, triangle_ends = NULL, col_inf = NULL, col_sup = NULL, colNA = NULL, color_fun = clim.palette(), bar_extra_margin = rep(0, 4), vertical = TRUE, toptitle = NULL, caption = NULL, units = NULL, crop_coastlines = NULL, point_size = "auto", title_size = 16, dots_size = 0.5, dots_shape = 47, coastlines_width = 0.3, fileout = NULL, width = 8, height = 4, size_units = "in", res = 300) { data <- drop(data) if (length(dim(data)) != 2) { stop("Parameter 'data' must have two dimensions.") } dims <- dim(data) if (is.null(lon_dim)) { lon_dim <- names(dims)[names(dims) %in% .KnownLonNames()] if (identical(lon_dim, character(0))) { stop("Cannot find known longitude name in data dimension. Please define parameter 'lon_dim'.") } } if (is.unsorted(lon)) { .warning("Parameter 'lon' should be sorted to guarantee the correct result.") } if (is.null(lat_dim)) { lat_dim <- names(dims)[names(dims) %in% .KnownLatNames()] if (identical(lat_dim, character(0))) { stop("Cannot find known latitude name in data dimension. Please define parameter 'lat_dim'.") } } if (!all(names(dims) %in% c(lat_dim, lon_dim))) { stop("Dimensions names in paramter 'data' should match 'lat_dim' and 'lon_dim.") } if (length(lon) != dims[lon_dim]) { stop("Length of parameter 'lon' should match longitude dimension in 'data'.") } if (length(lat) != dims[lat_dim]) { stop("Length of parameter 'lat' should match latitude dimension in 'data'.") } data <- s2dv::Reorder(data, c(lon_dim, lat_dim)) sort_lat <- FALSE if (!is.unsorted(lat)) { lat <- rev(lat) data <- ClimProjDiags::Subset(data, along = lat_dim, indices = seq(length(lat), 1, -1)) sort_lat <- TRUE } original_proj <- st_crs(4326) if (is.null(target_proj)) { stop("Parameter 'target_proj' cannot be NULL.") } else { target_proj_tmp <- st_crs(target_proj) if (is.na(target_proj_tmp)) { .warning(paste0("Try ESRI code: ESRI:", target_proj)) target_proj <- st_crs(paste0("ESRI:", target_proj)) } else { target_proj <- target_proj_tmp } } if (!is.null(legend) && (!legend %in% c("s2dv", "ggplot2"))) { stop("Parameter 'legend' must be NULL, ggplot2 or s2dv.") } if (!style %in% c("point", "polygon") || length(style) != 1) { stop("Parameter 'style' must be 'point' or 'polygon'.") } if (style == "polygon") { if ((abs(diff(range(lon))) > 350 & abs(diff(range(lat))) > 175) | (prod(dim(data)) >= (180 * 360))) { if (!isTRUE(utils::askYesNo("The region seems to be global and style 'polygon' is chosen. It may be time- and memory-consuming to plot the map. Are you sure that you want to continue?"))) { return(invisible()) } } } if (!is.null(dots)) { dots <- drop(dots) if (any(!names(dim(dots)) %in% c(lon_dim, lat_dim))) { stop("Parameter 'dots' must have two dimensions named as longitude and latitude dimensions in 'data'.") } else { dots <- Reorder(dots, c(lon_dim, lat_dim)) } if (!identical(dim(dots), dim(data))) { stop("Parameter 'dots' must have the same dimensions as 'data'.") } else if (is.numeric(dots)) { if (all(dots %in% c(0, 1))) { dots <- array(as.logical(dots), dim = dim(dots)) } else { stop("Parameter 'dots' must have only TRUE/FALSE or 0/1.") } } else if (is.logical(dots)) { if (!all(dots %in% c(T, F))) { stop("Parameter 'dots' must have only TRUE/FALSE or 0/1.") } } else { stop("Parameter 'dots' must be a logical or numerical array.") } } if (!is.null(mask)) { mask <- drop(mask) if (any(!names(dim(mask)) %in% c(lon_dim, lat_dim))) { stop("Parameter 'mask' must have two dimensions named as longitude and latitude dimensions in 'data'.") } else { mask <- Reorder(mask, c(lon_dim, lat_dim)) } if (!identical(dim(mask), dim(data))) { stop("Parameter 'mask' must have the same dimensions as 'data'.") } else if (is.numeric(mask)) { if (all(mask %in% c(0, 1))) { mask <- array(as.logical(mask), dim = dim(mask)) } else { stop("Parameter 'mask' must have only TRUE/FALSE or 0/1.") } } else if (is.logical(mask)) { if (!all(mask %in% c(T, F))) { stop("Parameter 'mask' must have only TRUE/FALSE or 0/1.") } } else { stop("Parameter 'mask' must be a logical or numerical array.") } } if (!all(is.na(data))) { var_limits <- c(min(data[!is.infinite(data)], na.rm = TRUE), max(data[!is.infinite(data)], na.rm = TRUE)) } else { warning("All the data are NAs. The map will be filled with colNA.") if (!is.null(brks) && length(brks) > 1) { var_limits <- c(min(brks, na.rm = TRUE) + diff(brks)[1], max(brks, na.rm = TRUE)) } else if (!is.null(bar_limits)) { var_limits <- c(bar_limits[1] + 0.01, bar_limits[2]) } else { var_limits <- c(-0.5, 0.5) if (!is.null(legend)) { legend <- NULL warning("All data are NAs. Color bar won't be drawn. If you want to have ", "color bar still, define parameter 'brks' or 'bar_limits'.") } } } colorbar <- ColorBar(brks = brks, cols = cols, vertical = vertical, subsampleg = NULL, bar_limits = bar_limits, var_limits = var_limits, triangle_ends = triangle_ends, col_inf = col_inf, col_sup = col_sup, color_fun = color_fun, plot = FALSE, draw_ticks = TRUE, draw_separators = FALSE, triangle_ends_scale = 1, extra_labels = NULL, title = units, title_scale = 1, label_scale = 1, tick_scale = 1, extra_margin = bar_extra_margin, label_digits = 4) brks <- colorbar$brks cols <- colorbar$cols col_inf <- colorbar$col_inf col_sup <- colorbar$col_sup bar_limits <- c(head(brks, 1), tail(brks, 1)) if (is.null(colNA)) { if ("na_color" %in% names(attributes(cols))) { colNA <- attr(cols, "na_color") if (!.IsColor(colNA)) { stop("The 'na_color' provided as attribute of the colour vector must be a valid colour identifier.") } } else { colNA <- "pink" } } else if (!.IsColor(colNA)) { stop("Parameter 'colNA' must be a valid colour identifier.") } if (!is.null(toptitle) && !is.character(toptitle)) { stop("Parameter 'toptitle' must be a character string.") } if (!is.null(caption) && !is.character(caption)) { stop("Parameter 'caption' must be a character string.") } if (!is.null(crop_coastlines)) { if (is.null(names(crop_coastlines))) { names(crop_coastlines) <- c("lonmin", "lonmax", "latmin", "latmax") } else if (!identical(sort(names(crop_coastlines)), sort(c("latmax", "latmin", "lonmax", "lonmin")))) { stop("Parameter 'crop_coastlines' needs to have names 'latmax', 'latmin', 'lonmax', 'lonmin'.") } } if (point_size == "auto") { point_size <- round(0.05 * (360 * 181)/(length(lon) * length(lat)), 2) } else if (!is.numeric(point_size)) { stop("Parameter 'point_size' must be a number.") } if (is.null(legend) || legend == "s2dv") { col_inf_image <- ifelse(is.null(col_inf), colNA, col_inf) col_sup_image <- ifelse(is.null(col_sup), colNA, col_sup) cols_ggplot <- c(col_inf_image, cols, col_sup_image) brks_ggplot <- brks if (var_limits[2] > tail(brks, 1)) { brks_ggplot <- c(brks_ggplot, max(data, na.rm = T)) } else { brks_ggplot <- c(brks_ggplot, tail(brks, 1) + diff(tail(brks, 2))) } if (var_limits[1] < brks[1]) { brks_ggplot <- c(min(data, na.rm = T), brks_ggplot) } else { brks_ggplot <- c(brks[1] - diff(brks[1:2]), brks_ggplot) } } else { brks_ggplot <- brks cols_ggplot <- cols } lonlat_df <- data.frame(lon = rep(as.vector(lon), length(lat)), lat = sort(rep(as.vector(lat), length(lon)), decreasing = TRUE)) data_df <- lonlat_df %>% dplyr::mutate(dat = as.vector(data)) lonlat_df_ori <- NULL if (!is.null(mask)) { lonlat_df_ori <- st_as_sf(lonlat_df, coords = c("lon", "lat"), crs = original_proj) lonlat_df_ori <- st_transform(lonlat_df_ori, crs = target_proj) lonlat_df_ori <- as.data.frame(st_coordinates(lonlat_df_ori)) names(lonlat_df_ori) <- c("long", "lat") if (sort_lat) { mask <- ClimProjDiags::Subset(mask, along = lat_dim, indices = seq(length(lat), 1, -1)) } mask_df <- data.frame(lon = rep(as.vector(lon), length(lat)), lat = sort(rep(as.vector(lat), length(lon)), decreasing = TRUE), mask = as.vector(mask)) data_df <- data_df[mask_df$mask == TRUE, ] lonlat_df <- data_df[, 1:2] } data_df <- st_as_sf(data_df, coords = c("lon", "lat"), crs = original_proj) data_df <- st_transform(data_df, crs = target_proj) data_df <- data_df %>% dplyr::mutate(long = st_coordinates(data_df)[, 1], lat = st_coordinates(data_df)[, 2]) if (!is.null(dots)) { if (sort_lat) { dots <- ClimProjDiags::Subset(dots, along = lat_dim, indices = seq(length(lat), 1, -1)) } dots_df <- data.frame(lon = rep(as.vector(lon), length(lat)), lat = sort(rep(as.vector(lat), length(lon)), decreasing = TRUE), dot = as.vector(dots)) dots_df <- st_as_sf(dots_df, coords = c("lon", "lat"), crs = original_proj) dots_df <- st_transform(dots_df, crs = target_proj) dots_df <- dots_df %>% dplyr::mutate(long = st_coordinates(dots_df)[, 1], lat = st_coordinates(dots_df)[, 2]) dots_df <- subset(dots_df, dot == FALSE) } coastlines <- rnaturalearth::ne_coastline(scale = "medium", returnclass = "sf") if (!is.null(crop_coastlines)) { suppressWarnings({ coastlines <- st_crop(coastlines, xmin = as.numeric(crop_coastlines["lonmin"]), xmax = as.numeric(crop_coastlines["lonmax"]), ymin = as.numeric(crop_coastlines["latmin"]), ymax = as.numeric(crop_coastlines["latmax"])) }) } coastlines <- st_transform(coastlines, crs = target_proj) if (style == "polygon") { d_lon <- abs(lon[2] - lon[1])/2 d_lat <- abs(lat[2] - lat[1])/2 lon_poly <- lat_poly <- rep(NA, 4 * dim(lonlat_df)[1]) for (ii in 1:dim(lonlat_df)[1]) { lon_poly[(ii * 4 - 3):(ii * 4)] <- c(lonlat_df$lon[ii] - d_lon, lonlat_df$lon[ii] + d_lon, lonlat_df$lon[ii] + d_lon, lonlat_df$lon[ii] - d_lon) lat_poly[(ii * 4 - 3):(ii * 4)] <- c(lonlat_df$lat[ii] - d_lat, lonlat_df$lat[ii] - d_lat, lonlat_df$lat[ii] + d_lat, lonlat_df$lat[ii] + d_lat) } lat_poly[which(lat_poly > 90)] <- 90 lat_poly[which(lat_poly < -90)] <- -90 lonlat_df <- data.frame(lon = lon_poly, lat = lat_poly) proj_lonlat <- st_as_sf(lonlat_df, coords = c("lon", "lat"), crs = original_proj) proj_lonlat <- st_transform(proj_lonlat, crs = target_proj) lonlat_df_proj <- st_coordinates(proj_lonlat) ids <- factor(paste0("id_", 1:dim(data_df)[1])) values <- data.frame(id = ids, value = data_df$dat) positions <- data.frame(id = rep(ids, each = 4), x = lonlat_df_proj[, 1], y = lonlat_df_proj[, 2]) datapoly <- merge(values, positions, by = "id") datapoly <- st_as_sf(datapoly, coords = c("x", "y"), crs = target_proj) datapoly <- datapoly %>% dplyr::group_by(id) %>% dplyr::summarise() %>% dplyr::mutate(value = values[order(values$id), ]$value) %>% st_cast("POLYGON") %>% st_convex_hull() } if (style == "polygon") { res_p <- ggplot(data = data_df) + geom_sf(data = datapoly, aes(col = cut(value, breaks = brks_ggplot, include.lowest = T), fill = cut(value, breaks = brks_ggplot, include.lowest = T))) } else if (style == "point") { res_p <- ggplot(data = data_df) + geom_point(aes(x = long, y = lat, col = cut(dat, breaks = brks_ggplot, include.lowest = T)), size = point_size) } if (is.null(lonlat_df_ori)) { coord_sf_lim <- c(range(data_df$long), range(data_df$lat)) } else { coord_sf_lim <- c(range(lonlat_df_ori$long), range(lonlat_df_ori$lat)) } res_p <- res_p + geom_sf(data = coastlines, colour = "black", size = coastlines_width) + theme_void() + theme(plot.background = element_rect(fill = "white", colour = "white")) + coord_sf(xlim = coord_sf_lim[1:2], ylim = coord_sf_lim[3:4], expand = TRUE, datum = target_proj) if (!is.null(dots)) { res_p <- res_p + geom_point(data = dots_df, aes(x = long, y = lat), shape = dots_shape, size = dots_size) } if (identical(legend, "ggplot2")) { if (style == "polygon") { res_p <- res_p + scale_colour_manual(values = cols_ggplot, aesthetics = c("colour", "fill"), drop = FALSE, na.value = colNA) + guides(fill = guide_legend(title = units, override.aes = list(size = 1)), color = "none") } else if (style == "point") { res_p <- res_p + scale_colour_manual(values = cols_ggplot, drop = FALSE, na.value = colNA) + guides(colour = guide_legend(title = units, override.aes = list(size = 1))) } } else { if (style == "polygon") { res_p <- res_p + scale_colour_manual(values = cols_ggplot, aesthetics = c("colour", "fill"), drop = FALSE, na.value = colNA) } else if (style == "point") { res_p <- res_p + scale_colour_manual(values = cols_ggplot, drop = FALSE, na.value = colNA) } res_p <- res_p + theme(legend.position = "none", plot.margin = margin(0.5, 0, 0, 0, "cm")) } if (!is.null(toptitle)) { res_p <- res_p + ggtitle(toptitle) + theme(plot.title = element_text(size = title_size, hjust = 0.5, vjust = 3)) } if (!is.null(caption)) { res_p <- res_p + labs(caption = caption) + theme(plot.caption = element_text(hjust = 0, vjust = 1, margin = margin(0, 0, 0, 0, "cm"))) } if (identical(legend, "s2dv")) { fun_legend <- function() { if (vertical) { par(mar = c(7.1, 2.2, 7.1, 3.1), mgp = c(3, 1, 0)) } else { par(mar = c(1.1, 1.2, 0.1, 1.1), mgp = c(3, 1, 0)) } ColorBar(brks = brks, cols = cols, vertical = vertical, subsampleg = NULL, bar_limits = bar_limits, var_limits = var_limits, triangle_ends = triangle_ends, col_inf = col_inf, col_sup = col_sup, color_fun = color_fun, plot = TRUE, draw_ticks = TRUE, draw_separators = FALSE, triangle_ends_scale = 1, extra_labels = NULL, title = units, title_scale = 1, label_scale = 1, tick_scale = 1, extra_margin = bar_extra_margin, label_digits = 4) } if (vertical) { res_p <- cowplot::plot_grid(res_p, fun_legend, rel_widths = c(6, 1)) } else { res_p <- cowplot::plot_grid(res_p, fun_legend, rel_heights = c(5, 1), ncol = 1) } res_p <- res_p + theme(plot.background = element_rect(fill = "white", colour = "white")) } if (!is.null(fileout)) { ext <- regmatches(fileout, regexpr("[a-zA-Z0-9]*$", fileout)) ggsave(fileout, res_p, width = width, height = height, dpi = res, units = size_units, device = ext) } else { dev.new(units = size_units, res = res, width = width, height = height) res_p }})(data = c(0.05498417721519, 0.0112577639751554, 0.0625000000000001, 0.208462732919255, 0.149771341463415, 0.20922256097561, 0.177018633540373, 0.221518987341772, 0.0312500000000001, 0.0197981366459629, 0.049923780487805, 0.0846518987341773, 0.0077639751552796, 0.145174050632911, 0.0244565217391305, 0.117879746835443, 0.011814024390244, 0.125388198757764, 0.0830745341614909, 0.0597826086956523, 0.236661585365854, 0.277950310559006, 0.237042682926829, 0.229813664596273, 0.0384908536585367, -0.0112577639751552, 0.0100931677018634, 0.0271739130434784, 0.0609472049689442, -0.0256211180124222, 0.0138449367088608, 0.103260869565218, 0.166930379746836, 0.122282608695652, -0.0170807453416146, -0.00316455696202511, 0.0874208860759493, 0.0753105590062114, 0.123447204968944, 0.0590062111801244, -0.031055900621118, 0.112965838509317, -0.0253164556962024, -0.0652173913043477, -0.134704968944099, 0.0358231707317074, 0.0973101265822787, 0.0388719512195123, 0.0846273291925468, -0.0585443037974682, 0.0470727848101268, 0.0881211180124225, 0.0155279503105592, -0.0547360248447204, -0.0545886075949367, -0.0144817073170731, 0.0527950310559008, 0.136645962732919, 0.033623417721519, -0.0275621118012421, -0.038109756097561, 0.0887957317073171, 0.13109756097561, 0.159298780487805, 0.000791139240506444, 0.166930379746835, 0.107199367088608, 0.0504658385093169, 0.111946202531646, 0.107594936708861, 0.136075949367089, 0.107469512195122, 0.0763449367088609, 0.0377286585365854, 0.033385093167702, -0.0450310559006208, -0.0304588607594936, 0.0759493670886077, 0.209239130434783, 0.306288819875777, -0.253493788819876, 0.10245253164557, 0.0292721518987343, -0.0062111801242235, 0.106408227848101, -0.0803571428571428, 0.137810559006211, 0.142009493670886, 0.192073170731707, 0.105590062111801, 0.0861280487804879, 0.171112804878049, -0.03876582278481, 0.071265243902439, 0.320503048780488, 0.334603658536585, -0.364906832298136, 0.10245253164557, 0.0890031645569621, 0.112341772151899, 0.0167682926829269, 0.0387658227848102, 0.136814024390244, 0.392149390243902, 0.259889240506329, 0.194224683544304, 0.257621951219512, 0.0974378881987579, -0.0493012422360248, 0.0474683544303798, 0.28416149068323, 0.21123417721519, -0.144778481012658, 0.0399844720496896, 0.0733695652173915, 0.234572784810127, 0.166537267080746, 0.0925632911392407, -0.0388198757763973, 0.258928571428572, 0.345108695652174, 0.337025316455696, 0.0415372670807455, 0.147903726708075, 0.197408536585366, 0.0869565217391306, 0.241459627329193, 0.240683229813665, -0.0874208860759493, 0.0174050632911393, 0.237737341772152, 0.105221518987342, 0.17998417721519, 0.125, 0.076740506329114, 0.34860248447205, 0.384146341463415, 0.273680124223603, 0.124223602484472, 0.205300632911392, 0.330745341614907, 0.43361801242236, 0.279891304347826, 0.312881097560976, -0.135481366459627, -0.0356012658227847, 0.0415372670807455, -0.0708841463414633, 0.0764751552795032, 0.20922256097561, 0.40625, 0.232531055900621, 0.218354430379747, 0.305124223602485, 0.201863354037267, 0.327639751552795, 0.0486550632911393, 0.188664596273292, 0.25582298136646, 0.33504746835443, -0.145198170731707, -0.0454905063291138, -0.0943322981366459, -0.0969145569620251, 0.276107594936709, -0.0684335443037973, -0.0593354430379747, -0.174689440993788, -0.169699367088607, 0.222179878048781, 0.134889240506329, 0.26503164556962, 0.310522151898734, 0.336180124223603, 0.179193037974684, 0.252329192546584, -0.290348101265823, -0.171112804878049, -0.0925632911392404, -0.241459627329192, 0.208460365853659, 0.102872670807454, 0.0617088607594937, 0.002717391304348, 0.0495426829268293, 0.218354430379747, 0.336509146341463, 0.360248447204969, 0.496894409937888, 0.399068322981367, 0.314082278481013, 0.277562111801242, -0.304496951219512, -0.296493902439024, -0.321428571428571, -0.20807453416149, -0.118275316455696, 0.191060126582279, 0.0815217391304349, 0.0454192546583853, 0.127717391304348, 0.253048780487805, 0.303401898734177, 0.502373417721519, 0.421493902439024, 0.432357594936709, 0.387957317073171, 0.24805900621118), mask = c(FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE), lon = c(-9.18798828125, -8.25, -7.31201171875, -6.37399291992188, -5.43600463867188, -4.49798583984375, -3.55999755859375, -2.62200927734375, -1.68399047851562, -0.746002197265625, 0, 0.938000023365021, 1.87600004673004, 2.81399989128113, 3.75200009346008, 4.69000005722046), lat = c(45.8265686035156, 44.8816947937012, 43.9368171691895, 42.991943359375, 42.0470657348633, 41.1021919250488, 40.1573143005371, 39.2124366760254, 38.2675590515137, 37.3226852416992, 36.3778076171875, 35.4329299926758, 34.4880523681641), lon_dim = "longitude", lat_dim = "latitude", target_proj = 54030L, legend = "s2dv", style = "point", brks = c(-1, -0.8, -0.6, -0.4, -0.2, 0, 0.2, 0.4, 0.6, 0.8, 1), cols = c("#1E61A5", "#3C8ABE", "#7CB7D6", "#BAD9E9", "#E5EEF3", "#F9EAE1", "#F9C7AD", "#EB9273", "#CF5246", "#AB1529"), col_inf = "#053061", col_sup = NULL, units = NULL, caption = "test\nthis is a test", toptitle = "NCEP CFSv2 / 2 Metre Temperature \n RPSS / valid week 2016-08-11 / 2010-2020", fileout = "/esarchive/scratch/abatalla/outputs_abatalla/subseasonal/out0704-dev-r//plots//NCEP-CFSv2/raw-weekly_mean/tas/hcst-20030806/rpss-20030806_ft20160811.pdf")
34: do.call(fun, args = c(base_args, list(toptitle = toptitle, fileout = fileout)))
35: plot_metrics(recipe = recipe, data_cube = data$hcst, metrics = skill_metrics, outdir = outdir, significance = significance, output_conf = output_conf)
36: Visualization(recipe = datos[[1]], data = datos[[2]], skill_metrics = datos[[3]], significance = TRUE)
Possible actions:
1: abort (with core dump, if enabled)
2: normal R exit
3: exit R without saving workspace
4: exit R saving workspace
Selection:
Cheers,
Ariadna