Skip to content

Commit

Permalink
Merge pull request #197 from OHI-Science/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
gclawson1 authored Dec 6, 2021
2 parents fb1f8f6 + 4ee6111 commit 3bb30b7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions R/CalculateGoalIndex.R
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ CalculateGoalIndex <- function(id, status, trend, resilience, pressure,
d$r <- ifelse(is.na(d$r), 0, d$r)
d$p <- ifelse(is.na(d$p), 0, d$p)

## cap the resilience so that it is no more than the pressures.
d$r <- ifelse(d$r > d$p, d$p, d$r)

d$xF <- with(d, (DISCOUNT * (1 + (BETA * t) + ((1-BETA) * (r - p)))) * x)
# clamp status domain to [0, 1]
d$xF <- with(d, score.clamp(xF, xlim = c(0,1)))
Expand Down

0 comments on commit 3bb30b7

Please sign in to comment.