# NOT RUN {
library(GD)
f1 <- formula(NDVIchange ~ Tempchange + Precipitation + Popdensity)
odc1 <- optidisc(f1, ndvi_40, discmethod = "quantile", discitv = c(3:20))
xvar <- all.vars(f1)[-1]
nx <- length(xvar)
dm <- do.call(data.frame, lapply(1:nx, function(u) odc1[[u]]$qv.matrix))
names(dm) <- xvar
pd <- plotdisc(discmatrix = dm, group = rep(1:6, each = 3))
# }
Run the code above in your browser using DataLab