Skip to content

Commit

Permalink
fix functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Brooke Gibbons committed Jul 10, 2024
1 parent e6dc857 commit a6d3114
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 10 deletions.
4 changes: 3 additions & 1 deletion R/generate_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ generate_data <- function(raw_dir, save = TRUE, dest = here::here("inst/data/mpa
year,
# month, day,
gazetted, re_zoned, complete, dbca_zone, dbca_sanctuary) %>% # Trying to remove columns to save space/time to load the app
dplyr::filter(!campaignid %in% c("2021-05_JurienBay.MP.Monitoring_UVC"))
dplyr::filter(!campaignid %in% c("2021-05_JurienBay.MP.Monitoring_UVC")) # removed due to double up with 2021 ROVs

names(metadata) %>% sort() # All the names of the dataframe
unique(metadata$marine_park) %>% sort()
Expand Down Expand Up @@ -815,6 +815,8 @@ generate_data <- function(raw_dir, save = TRUE, dest = here::here("inst/data/mpa
# ab_mpa$waname[ab_mpa$ZONE_TYPE == unique(ab_mpa$ZONE_TYPE)[14]] <-
# c("Special Purpose Zone\n(Habitat Protection)")

# TODO add Rottnest

wampa$waname[wampa$NAME == "Hamelin Pool"] <- "Marine Nature Reserve"
wampa$waname[wampa$NAME == "Abrolhos Islands"] <- "Fish Habitat Protection Area"

Expand Down
10 changes: 7 additions & 3 deletions R/generate_plots.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#' Generate one data object to use in server.R
#' Generate plots to display in the dashboard
#'
#'
#' @return All plots
Expand Down Expand Up @@ -1136,10 +1136,12 @@ generate_plots <- function() {

temp2 <- temp[method %in% c(methods)]

# TODO think about changing the cut off

species_above_zero <- temp2 %>%
dplyr::group_by(scientific_name) %>%
dplyr::summarise(total = sum(mean)) %>%
dplyr::filter(total > 0) %>%
dplyr::filter(total > 3) %>%
dplyr::ungroup()

for(species in unique(species_above_zero$scientific_name)){
Expand Down Expand Up @@ -1234,10 +1236,12 @@ generate_plots <- function() {

temp2 <- temp[method %in% c(methods)]

# TODO think about changing the cut off

species_above_zero <- temp2 %>%
dplyr::group_by(scientific_name) %>%
dplyr::summarise(total = sum(mean)) %>%
dplyr::filter(total > 0) %>%
dplyr::filter(total > 3) %>%
dplyr::ungroup()

for(species in unique(species_above_zero$scientific_name)){
Expand Down
6 changes: 5 additions & 1 deletion man/generate_data.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/generate_plots.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/googledrive_download_data.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/read_dbca_files_csv.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/read_dbca_files_txt.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a6d3114

Please sign in to comment.