Skip to content

Commit

Permalink
Revert "Update CI_1_Generate_reports.R"
Browse files Browse the repository at this point in the history
This reverts commit d5ffff3.
  • Loading branch information
markus1bauer committed Apr 19, 2024
1 parent 5e069bd commit 0befc82
Showing 1 changed file with 21 additions and 25 deletions.
46 changes: 21 additions & 25 deletions R/CI_1_Generate_reports.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
library(dplyr)
library(forcats)
library(ggplot2)
library(gt)
library(here)
library(kableExtra)
library(knitr)
Expand All @@ -20,6 +19,7 @@ webshot::install_phantomjs()

### Start ###
rm(list = ls())
renv::status()



Expand Down Expand Up @@ -54,22 +54,18 @@ sites <- read_csv(
values_transform = list (n = as.character)
) %>%
pivot_wider(names_from = "x", values_from = "n") %>%
mutate(
plot = str_replace(plot, "-", "_"),
plot = str_replace(plot, "L_", "L"),
plot = str_replace(plot, "W_", "W"),
id = str_c(plot, survey_year, sep = "_"),
plot = factor(plot),
id = factor(id),
vegetation_cover = as.numeric(vegetation_cover)
) %>%
filter(
!(site == "C" & (survey_year == "seeded" |
survey_year == "2018" |
survey_year == "2019" |
survey_year == "2020" |
survey_year == "2021"))
)
mutate(plot = str_replace(plot, "-", "_"),
plot = str_replace(plot, "L_", "L"),
plot = str_replace(plot, "W_", "W"),
id = str_c(plot, survey_year, sep = "_"),
plot = factor(plot),
id = factor(id),
vegetation_cover = as.numeric(vegetation_cover)) %>%
filter(!(site == "C" & (survey_year == "seeded" |
survey_year == "2018" |
survey_year == "2019" |
survey_year == "2020" |
survey_year == "2021")))



Expand Down Expand Up @@ -155,8 +151,9 @@ values <- seq(from = 0, to = 100, by = 5)

### Check typos of sites cover ###
data <- sites %>%
#filter(!str_detect(id, "_seeded$")) %>%
filter(!(vegetation_cover %in% values) & !is.na(vegetation_cover))
filter(!str_detect(id, "_seeded$")) %>%
filter(!(vegetation_cover %in% values) &
!is.na(vegetation_cover))

file <- here("tests", "testthat", "warnings_sites_typos.png")

Expand All @@ -170,10 +167,10 @@ if(count(data) == 0) {

} else {

data %>%
gt() %>%
tab_options(table.font.size = px(10)) %>%
gtsave(file)
data #%>%
#gt() %>%
#tab_options(table.font.size = px(10)) %>%
#gtsave(file)

}

Expand Down Expand Up @@ -233,8 +230,7 @@ data <- species %>%
select(id, survey_year, vegetation_cover, value, diff) %>%
filter(!str_detect(id, "_seeded$")) %>%
filter(diff > 20 | diff < -5) %>%
arrange(survey_year, id, diff) #%>%
#mutate(warning_name == "warnings_different_total_cover")
arrange(survey_year, id, diff)

file <- here("tests", "testthat", "warnings_different_total_cover.png")

Expand Down

0 comments on commit 0befc82

Please sign in to comment.