Go to TogaWare.com Home Page. Data Science Desktop Survival Guide
by Graham Williams
Duck Duck Go

Executing Code

Raw To send R commands to the R Console we can use the appropriate toolbar buttons. One line or a highlighted region can be sent using the Run button. Having opened a new R script file we can enter the commands below. The four commands make up a program which begins with an install.packages() to ensure we have installed two requisite software packages for R. The second and third commands use library() to load those packages into the current R session. The fourth command produces a plot of the weatherAUS dataset. This dataset contains daily observations of weather related variables across some 50 weather stations in Australia over multiple years.
install.packages(c("ggplot2", "rattle"))
library(ggplot2)
library(rattle)
qplot(data=weatherAUS, x=MinTemp, y=MaxTemp)

qplot() allows us to quickly code a plot. Using the weatherAUS dataset we plot the minimum daily temperature (MinTemp) on the x-axis against the maximum daily temperature (MaxTemp) on the y-axis. The resulting plot is a scatter plot as we see the plot in the lower right pane.

Figure: Running R commands in . The R programming code is written into a file using the editor in the top left pane. With the cursor on the line containing the code we click the Run button to pass the code on to the R Console to have it run by the R Interpreter to produce the plot we see in the bottom right pane.
Image rstudio_weatherAUS_scatterplot_annotate

Support further development by purchasing the PDF version of the book.
Other online resources include the GNU/Linux Desktop Survival Guide.
Books available on Amazon include Data Mining with Rattle and Essentials of Data Science.
Popular open source software includes rattle and wajig.
Hosted by Togaware, a pioneer of free and open source software since 1984.
Copyright © 2000-2020 Togaware Pty Ltd. . Creative Commons ShareAlike V4.