data(vehicles)
X <- vehicles[, 1:11]
Y <- vehicles[, 12:15]
X <- scale(X)
Y <- scale(Y) # The scales of Y are vastly different, so scaling is reasonable here
if (FALSE) m <- rrenv.apweights(X, Y, 3, 2)
if (FALSE) m
if (FALSE) X <- as.matrix(X)
if (FALSE) pred.res <- pred.rrenv.apweights(m, X[2, ])
if (FALSE) pred.res
Run the code above in your browser using DataLab