Why can't I generate for the topsis
method, choosing a w <- c(1, 0)
? As far as I know it has to be the sum of the weights equal to 1. And it's weird that if I put w <- c(1, 1)
it works. But why, since the sum of the weights must equal 1?
library(topsis)
df1 <- structure(list(n = c(2, 3, 4, 5, 6, 7, 8, 9, 10, 11),
Coverage = c(0.0363201192049018, 0.0315198954715543,
0.112661460735583, 0.112661460735583, 0.112661460735583, 0.0813721071219816,
0.0862146652218061, 0.0697995564757394, 0.0599194966471805,
0.0507632014547115),
Production =
c(1635156.04305, 474707.64025, 170773.40775, 64708.312, 64708.312, 64708.312,
949.72635, 949.72635, 949.72635, 949.72635)),
class = "data.frame", row.names = c(NA,-10L))
df2 <- df1[c(2:3)]
df2<-data.matrix(df2)
w <- c(1, 0)
i <- c("+", "-")
topsis(df2, w, i)
Error in topsis(df2, w, i) : weights must be positive numbers