- changed status to open
fancyRpartPlot can't find rpart.plot
Issue #3
resolved
This is using the fancyRpartPlot example in rattle 5.07. Is there something missing from the example?
> ## Use rpart to build a decision tree.
>
> library(rpart)
>
> ## Set up the data for modelling.
>
> set.seed(42)
> ds <- weather
> target <- "RainTomorrow"
> risk <- "RISK_MM"
> ignore <- c("Date", "Location", risk)
> vars <- setdiff(names(ds), ignore)
> nobs <- nrow(ds)
> form <- formula(paste(target, "~ ."))
> train <- sample(nobs, 0.7*nobs)
> test <- setdiff(seq_len(nobs), train)
> actual <- ds[test, target]
> risks <- ds[test, risk]
>
> # Build the model.
>
> model <- rpart(form, data=ds[train, vars])
>
> ## Plot the model.
>
> fancyRpartPlot(model)
Error in loadNamespace(name) : there is no package called ‘rpart.plot’
>
> ## Choose different colours
>
> fancyRpartPlot(model, palettes=c("Greys", "Oranges"))
Error in loadNamespace(name) : there is no package called ‘rpart.plot’
Comments (2)
-
repo owner -
repo owner - changed status to resolved
This appears to have been fixed already (tested on 5.0.16). Removing the rpart.plot package and then building a decision tree and then Draw results in a popup to request to install rpart.plot.
- Log in to comment
Need to update rattle to pick up this case and offer to load the package.