added conditional to skip field/subfield when no downloads available in current rds
This commit is contained in:
parent
11f2053e77
commit
2988516db2
|
|
@ -95,6 +95,9 @@ extract_CI_data <- function(field_names, harvesting_data, field_CI_data, season)
|
|||
|
||||
filtered_field_CI_data <- field_CI_data %>%
|
||||
filter(sub_field %in% field_names)
|
||||
if (nrow(filtered_field_CI_data) == 0) {
|
||||
return(data.frame()) # Return an empty data frame if no data is found
|
||||
}
|
||||
|
||||
# CI <- map_df(field_names, ~ {
|
||||
ApproxFun <- approxfun(x = filtered_field_CI_data$Date, y = filtered_field_CI_data$value)
|
||||
|
|
|
|||
Loading…
Reference in a new issue