CAS RPM: Installing & running Rattle in RStudio

April 12, 2017
By

(This article was first published on triKnowBits, and kindly contributed to R-bloggers)

At the Ratemaking and Product Management (RPM) seminar of the Casualty Actuarial Society (CAS) in San Diego last month, Linda Brobeck, Peggy Brinkmann, and yours truly gave a concurrent session on a machine learning technique called decision tree analysis. See the DSPA-2 session — and other sessions — at this link. Technical issues precluded showing the video of  installing and running Rattle within RStudio. Thus this post.

As Peggy notes, installing and running Rattle takes only three “commands” in R:

  install.packages(“rattle”, dependencies=c(‘Depends’, “Suggests”))
  library(rattle)

  rattle()

Although not necessary, the “Suggests” option above can avoid Rattle’s annoying requests for more packages as you click through its GUI; the downside is the time to download and install about 900 packages. Below (“Read more >>”) is a link to a video of me running through the three lines above:

download/install Rattle

For those whose IT departments restrict installing R and RStudio on company equipment, this presentation used the software on a USB drive. The first minute or so of the video shows me setting up the shortcut on the USB drive so RStudio runs without a bunch of confusing questions, especially for a newbie. If you have R and RStudio installed on your computer already, you can fast forward through the first minute. 
Peggy put her three lines of code into a script called ‘Rattle.R’. That’s the file I double-click around the 1:10 mark. You can see the three lines of the script in the upper left pane of RStudio.
I run the first line starting at 8:17 am, which finishes at 9:32 am (the 1:42 mark in the video). Plenty of time to read the newspaper.
Then I run the second line which, despite the “Depends” and “Suggests” settings above, has to download and install yet another package, GTK+. (There are reasons why that’s necessary, but not important right now.) That takes just a few minutes.
Then I run the third line, which fires up the Rattle user interface (GUI). It’s a little hard to see, but the Rattle GUI shows up as another process running in the taskbar.
At this point you can start using rattle/rpart per Peggy’s presentation. The links to our three presentations are reproduced here for convenience:

Contact me if questions.

To leave a comment for the author, please follow the link and comment on their blog: triKnowBits.

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...



If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.

Sponsors

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)