d <- wq_demo
# create minimal aliases so the prototype can run
d$do <- d$od
d$fc <- d$coliformes
d$ph <- d$ph
d$bod <- d$dbo
# others are missing; use na_rm = TRUE to rescale weights by row
out <- nsfwqi(d, na_rm = TRUE)
head(out$NSFWQI)
Run the code above in your browser using DataLab