# NOT RUN {
# since Species is a factor the following performs multiclass classification
modelIris <- svm(Species ~ ., iris)
# equivalently
modelIris <- svm(iris[,1:4], iris$Species)
# since Height is numeric the following performs least-squares regression
modelTrees <- svm(Height ~ Girth + Volume, trees)
# equivalently
modelTrees <- svm(trees[,c(1,3)],trees$Height)
# }
Run the code above in your browser using DataLab