Skip to content

Commit

Permalink
Merge pull request #112 from AgrDataSci/devel
Browse files Browse the repository at this point in the history
map
  • Loading branch information
kauedesousa authored Jun 5, 2023
2 parents 5cad87d + f0162bd commit b2750f0
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 7 deletions.
5 changes: 3 additions & 2 deletions modules/05_spatial_overview.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)

}

Expand Down
36 changes: 31 additions & 5 deletions modules/10_quantitative_insights.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -16,18 +38,22 @@ 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 = "") +
theme_bw() +
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(" ", "",
Expand Down

0 comments on commit b2750f0

Please sign in to comment.