fancyRpartPlot can't find rpart.plot

Issue #3 resolved
Nick Murray created an issue

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 calledrpart.plot> 
> ## Choose different colours
> 
> fancyRpartPlot(model, palettes=c("Greys", "Oranges"))
Error in loadNamespace(name) : there is no package calledrpart.plot

Comments (2)

  1. Graham Williams repo owner

    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.

  2. Log in to comment