• Home
  • Swinburne University of Technology
  • Data Mining
  • Installing and Using R, RStudio, and Rattle for Data Analysis

Installing and Using R, RStudio, and Rattle for Data Analysis

STA30004: Data Mining Tutorial 2019 Week 3 a) Installing R, then RStudio and finally rattle R and RStudio have already been installed in the computer lab but you may need to install them at home. We recommend the Melbourne(1) CRAN. (See https://www.r-project.org/ and https://www.rstudio.com/products/rstudio/download/). Now instructions for loading rattle. This has to be done in the computer lab and at home after entering RStudio. It does not work for me if I do not have RStudio open. Choose the appropriate platform. In the lab we are using Windows. Use the Melbourne(1) CRAN mirror when prompted. You may be prompted to load additional packages. Any OS > install. packages ("https: //togaware. com/access/rattle 5.0.14. tar.gz", repos=NULL, type="source") Linux > install. packages ("rattle") > install. packages ("https://cran.r- project. org/src/contrib/Archive/RGtk2/RGtk2 2.20.31. tar.gz", repos=NULL) Windows > install. packages ("rattle") > install. packages ("https: //cran.r- project. org/bin/windows/contrib/3.3/RGtk2 2.20. 31. zip", repos=NULL) If working at home make sure that you have downloaded GGOBI from the web site www.ggobi.org. b) In RStudio command line enter the following one line at a time. 1 library(rattle) > rattle() c) Click on Execute in the GUI and ask for weather.csv i) Check that Rattle has correctly guessed the data type for each variable. ii) Use the View button to see the worksheet. iii) Be careful with the Edit button. Document any changes. d) Assign appropriate roles. We want to see if there are changes over time. i) RainTomorrow is the Target Variable. ii) Date, Pressure3pm, Cloud3pm are the only input variables 1 iii) Ignore all other variables. Then Execute. e) Explore > Interactive > GGOBI. Then Execute f) Does there appear to be a time trend for Pressure3pm? File Display View Interaction Tools Help XY Plot x Y Date Plot cycling x Cycle x No fixed axes x Y Pressure3pm Y Cloud3pm Y RainTomorrow File Edges Options Pressure3pm Change direction Date g) Is there a time trend for Cloud3pm or RainTomorrow? h) Now click on Interaction>Brush Choose "Colour and Glyphs". Create Big Red points for brushing. F Color & Glyph Chooser Shows the . + * × + X 0 + X O + X 0 C + 0 + + X Foreground colors Background color Accent color Shadow color iv) Location must be ignored because there is no useful information in this variable. Always set equal to "Canberra". i) Brush any outliers and see what happens on any graphs you have open. Does rain fall on the day that has the lowest 3pm Pressure? 2 File Display View Interaction Tools Help Brush x Y Date Choose color & glyph ... x Pressure3pm Eile Edges Options Brush Pressure3pm File Edges Options Brush RainTomorrow .... .. 1 Persistent Undo x Point brushing: x 1 Color and glyph Y Cloud3pm Y RainTomorrow Edge brushing: Off . Case ID Date RainTomorrow Date Date j) Use the Interaction>Identify option to determine the date for the above outlier. k) Now produce a matrix plot (New Scatterplot Matrix). Unbrush the red spot if it is annoying. File