# NOT RUN {
### dontrun is used here to avoid the creation of a new file
### in the CRAN servers. The example should work fine:
# }
# NOT RUN {
data(iris)
M=fit(Species~.,iris,model="rpart")
tempdirpath=tempdir()
filename=paste(tempdirpath,"/iris.model",sep="")
savemodel(M,filename) # saves to file
M=NULL # cleans M
M=loadmodel(filename) # load from file
print(M)
# }
Run the code above in your browser using DataLab