working rmd file, removed renv because it messed up my R and could not get it to work
BIN
CI_report_dashboard_planet_files/figure-html/sub_chunk_252-1.png
Normal file
|
After Width: | Height: | Size: 68 KiB |
|
After Width: | Height: | Size: 68 KiB |
|
After Width: | Height: | Size: 68 KiB |
|
After Width: | Height: | Size: 68 KiB |
|
After Width: | Height: | Size: 68 KiB |
|
After Width: | Height: | Size: 68 KiB |
|
Before Width: | Height: | Size: 5.8 KiB |
|
|
@ -1,7 +1,7 @@
|
||||||
# activeer de renv omgeving;
|
# activeer de renv omgeving;
|
||||||
|
|
||||||
renv::activate('~/smartCane/r_app')
|
# renv::activate('~/smartCane/r_app')
|
||||||
renv::restore()
|
# renv::restore()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
params:
|
params:
|
||||||
ref: "word-styles-reference-var1.docx"
|
ref: "word-styles-reference-var1.docx"
|
||||||
output_file: CI_report.docx
|
output_file: CI_report.docx
|
||||||
report_date: "2023-12-12"
|
report_date: "2024-04-18"
|
||||||
data_dir: "chemba"
|
data_dir: "chemba"
|
||||||
output:
|
output:
|
||||||
# html_document:
|
# html_document:
|
||||||
|
|
@ -23,8 +23,8 @@ report_date <- params$report_date
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
# # Activeer de renv omgeving
|
# # Activeer de renv omgeving
|
||||||
renv::activate()
|
# renv::activate()
|
||||||
|
# renv::deactivate()
|
||||||
# Optioneel: Herstel de omgeving als dat nodig is
|
# Optioneel: Herstel de omgeving als dat nodig is
|
||||||
# Je kunt dit commentaar geven als je het normaal niet wilt uitvoeren
|
# Je kunt dit commentaar geven als je het normaal niet wilt uitvoeren
|
||||||
# renv::restore()
|
# renv::restore()
|
||||||
|
|
@ -140,8 +140,8 @@ AllPivots <- merge(AllPivots0, harvesting_data, by = c("Field", "subField")) #%>
|
||||||
#rename(Field = pivot, subField = pivot_quadrant) #%>% select(-pivot.y)
|
#rename(Field = pivot, subField = pivot_quadrant) #%>% select(-pivot.y)
|
||||||
head(AllPivots)
|
head(AllPivots)
|
||||||
|
|
||||||
AllPivots_merged <- AllPivots %>%
|
AllPivots_merged <- AllPivots %>% #dplyr::select(Field, subField, sub_area) %>% unique() %>%
|
||||||
group_by(Field) #%>% summarise(sub_area = first(sub_area))
|
group_by(Field) %>% summarise(sub_area = first(sub_area))
|
||||||
|
|
||||||
AllPivots_merged <- st_transform(AllPivots_merged, crs = proj4string(CI))
|
AllPivots_merged <- st_transform(AllPivots_merged, crs = proj4string(CI))
|
||||||
|
|
||||||
|
|
@ -313,7 +313,7 @@ cum_ci_plot <- function(pivotName){
|
||||||
|
|
||||||
g <- ggplot(data= data_ci2 %>% filter(season %in% unique_seasons)) +
|
g <- ggplot(data= data_ci2 %>% filter(season %in% unique_seasons)) +
|
||||||
# facet_wrap(~Year, scales = "free_x") +
|
# facet_wrap(~Year, scales = "free_x") +
|
||||||
geom_line( aes(Date, mean_rolling10, col = Field)) +
|
geom_line( aes(Date, mean_rolling10, col = subField)) +
|
||||||
# geom_line(data= perfect_pivot, aes(Date , mean_rolling10, col = "Model CI (p5.1 Data 2022, \n date x axis is fictive)"), lty="11",size=1) +
|
# geom_line(data= perfect_pivot, aes(Date , mean_rolling10, col = "Model CI (p5.1 Data 2022, \n date x axis is fictive)"), lty="11",size=1) +
|
||||||
labs(title = paste("14 day rolling MEAN CI rate - Pivot ", pivotName))+
|
labs(title = paste("14 day rolling MEAN CI rate - Pivot ", pivotName))+
|
||||||
# scale_y_continuous(limits=c(0.5,3), breaks = seq(0.5, 3, 0.5))+
|
# scale_y_continuous(limits=c(0.5,3), breaks = seq(0.5, 3, 0.5))+
|
||||||
|
|
@ -400,13 +400,13 @@ pivots_grouped <- AllPivots_merged %>%
|
||||||
# Iterate over each subgroup
|
# Iterate over each subgroup
|
||||||
for (subgroup in unique(pivots_grouped$sub_area)) {
|
for (subgroup in unique(pivots_grouped$sub_area)) {
|
||||||
cat("\n")
|
cat("\n")
|
||||||
cat("\n # Subgroup: ", subgroup, "\n") # Add a title for the subgroup
|
cat("# Subgroup: ", subgroup, "\n") # Add a title for the subgroup
|
||||||
subset_data <- filter(pivots_grouped, sub_area == subgroup)
|
subset_data <- filter(pivots_grouped, sub_area == subgroup)
|
||||||
cat("\n")
|
cat('\\pagebreak')
|
||||||
walk(AllPivots_merged$Field, ~ {
|
walk(subset_data$Field, ~ {
|
||||||
cat("\n") # Add an empty line for better spacing
|
cat("\n") # Add an empty line for better spacing
|
||||||
ci_plot(.x)
|
ci_plot(.x)
|
||||||
cat("\n")
|
cat("\n")
|
||||||
cum_ci_plot(.x)
|
cum_ci_plot(.x)
|
||||||
cat("\n")
|
cat("\n")
|
||||||
})
|
})
|
||||||
|
|
|
||||||