Displaying 1 result from an estimated 1 matches for "cart_".
Did you mean:
cart
2011 Apr 22
3
Parametrized object name in Save statement
...commandArgs(TRUE) # Read the argument
require(rpart, quietly = TRUE)
#for this example lets use the kyphosis data in the rpart package
args <- "Kyphosis"
X<-paste(args," ~.", sep ="") # create model formula call. X = "Kyphosis ~."
assign(paste("cart_",args, sep =""),rpart(X, method="class",
data=kyphosis))
#NOW MY TROUBLE. I have an rpart object but cannot save it under a file name
that incorporates the parameter
#Here is the file name
file<-paste("cart_",args, sep ="")
#hard coding the rpart...