We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I think this could be simplified quite a bit with a couple of functions like
rescale01 <- function(x) { rng <- range(x, na.rm = TRUE) (x - rng[1]) / (rng[2] - rng[1]) } composite_score <- function(x, wt) { x <- rescale01(x) x <- x[!is.na(x)] mean(wt * x) }
(I think that's what you're doing, but I'm not absolutely sure)
The text was updated successfully, but these errors were encountered:
Similarly, when computing indexes, it would be a good idea to reduce some of the duplication with a function.
Sorry, something went wrong.
I pared down the code using your suggestion for rescale01 along with the weighted.mean function.
No branches or pull requests
I think this could be simplified quite a bit with a couple of functions like
(I think that's what you're doing, but I'm not absolutely sure)
The text was updated successfully, but these errors were encountered: