diff --git a/modules/05_spatial_overview.R b/modules/05_spatial_overview.R index dd776c8..61a4bdc 100644 --- a/modules/05_spatial_overview.R +++ b/modules/05_spatial_overview.R @@ -64,9 +64,10 @@ get_testing_sites_map = function(cmdata, output_path, backward_path){ dir.create(tempmap, recursive = TRUE, showWarnings = FALSE) - mapview::mapshot(trial_map, + try(mapview::mapshot(trial_map, url = paste0(tempmap, "/trial_map.html"), - file = paste0(tempmap, "/trial_map.png")) + file = paste0(tempmap, "/trial_map.png")), + silent = TRUE) } diff --git a/modules/10_quantitative_insights.R b/modules/10_quantitative_insights.R index 09e742c..9e35208 100644 --- a/modules/10_quantitative_insights.R +++ b/modules/10_quantitative_insights.R @@ -4,6 +4,28 @@ #' retained in the quanti_dat object #' #' @param quanti_dat a list with parameters +#' @examples +#' modules = list.files("modules", full.names = TRUE,pattern = ".R") +#' +#' modules = modules[-which(grepl("check_packages.R", modules))] +#' for (i in seq_along(modules)) { +#' source(modules[i]) +#' } +#' +#' load("modules/example-data-structure.rda") +#' +#' # ClimMob parameters +#' pars = decode_pars(cmpars) +#' +#' quanti_dat = organize_quantitative_data(cmdata, +#' pars, +#' groups = "gender1", +#' id = "id", +#' tech_index = paste0("package_item_", LETTERS[1:3])) +#' +#' +#' get_quantitative_summaries(quanti_dat) +#' @export get_quantitative_summaries <- function(quanti_dat) { # make density plots with the data @@ -16,10 +38,14 @@ get_quantitative_summaries <- function(quanti_dat) { ggdat_i <- quanti_dat$quanti_dat[[i]] - b_i <- ggplot(ggdat_i, aes(y = value, x = technology, color = technology)) + - geom_boxplot(show.legend = FALSE) + - geom_jitter(show.legend = FALSE) + - scale_color_brewer(palette = "BrBG", name = "") + + b_i <- ggplot(ggdat_i, aes(x = value, + y = technology, + color = "#006d2c")) + + geom_boxplot(show.legend = FALSE, + outlier.colour = "#d95f02") + + + #geom_jitter(show.legend = FALSE, color = "#006d2c") + + scale_color_manual(values = "#006d2c") + labs(title = paste(unique(ggdat_i$trait), unique(ggdat_i$data_collection), sep = " - "), x = "", y = "") + @@ -27,7 +53,7 @@ get_quantitative_summaries <- function(quanti_dat) { theme(panel.grid = element_blank(), text = element_text(size = 16), title = element_text(size = 12), - axis.text.x = element_text(angle = 45, hjust = 1)) + axis.text.x = element_text(angle = 0, hjust = 0.5)) densitplots[[i]] <- b_i density_file_names[[i]] <- tolower(gsub(" ", "",