Getting Up and Running with R
You can download R from the R website at www.r-project.org
. Just click the download link, pick a mirror nearest you, and download the installer for your OS.
Run through the installer (on Windows it's nice to install the software as the administrator) and then open the application. On Windows and Mac, the R console is going to load. It looks something like Figure 10.1.
Inside the R console, you type commands into the > prompt and press Return to get the system to do anything. Here's a couple for you:
> print("No regrets. Texas forever.")
[1] "No regrets. Texas forever."
> 355/113
[1] 3.141593
You can call the print
function to get the system to print out text. You can also type in arithmetic directly to make calculations. Now, my standard workflow for using R is:
- 1. Bring data into an R.
- 2. Do data-sciency things with data.
- 3. Dump results out of R where some other person or process...