Skip to content

Commit

Permalink
fix when no occurrence in a given plane
Browse files Browse the repository at this point in the history
  • Loading branch information
giocomai committed Nov 5, 2024
1 parent ca1490a commit 41e151c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions R/rv_create_risk_vector.R
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ rv_create_risk_vector <- function(risk_ratio,
risk_places_v <- rep(as.character(NA), total_places)

for (i in (unique(risk_ratio[[1]])[is.na(unique(risk_ratio[[1]])) == FALSE])) {
if (sum(is.na(risk_places_v))==0) {
break
}

selector <- sample(
x = seq_along(risk_places_v[is.na(risk_places_v) == TRUE]),
replace = FALSE,
Expand Down

0 comments on commit 41e151c

Please sign in to comment.