library(MASS)
data(Rubber)
# call ShapeSelect to find the best model by the genetic algorithm
fit <- ShapeSelect(loss ~ shapes(hard, set = "s.9") + shapes(tens, set = "s.9"),
data = Rubber, genetic = TRUE)
# plot fitness values against generations
plot(fit)
# call plotpersp on the best fit
plotpersp(fit$best.fit, th = 120)
Run the code above in your browser using DataLab