Skip to content

Commit

Permalink
Add missing argument to rdi period function
Browse files Browse the repository at this point in the history
  • Loading branch information
langbart committed Sep 22, 2023
1 parent 5d116c9 commit 6a55641
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/format-public-data.R
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ format_public_data <- function(log_threshold = logger::DEBUG) {
taxa = "MZZ"
) %>%
purrr::map(aggregate_nutrients, pars) %>%
purrr::map2(.x = ., .y = c(1, 7, 30.5, 365), get_period_rdi)
purrr::map2(.x = ., .y = c(1, 7, 30.5, 365), get_period_rdi, pars)


aggregated <-
Expand Down Expand Up @@ -834,7 +834,7 @@ jsonify_nutrients <- function(data) {
dat
}

get_period_rdi <- function(x, unit_days) {
get_period_rdi <- function(x, unit_days = NULL, pars) {
x %>%
dplyr::mutate(nut_rdi = dplyr::case_when(
nutrient == "selenium" ~ (.data$nut_supply * 1000) / unit_days / pars$metadata$nutrients$RDI$name$selenium,
Expand Down

0 comments on commit 6a55641

Please sign in to comment.