1. Download and install R on your computer
To download, either visit the R-Project site or Google with keywords "R, Download"
Double click what you have downloaded and follow instruction to install
2. Invoke R from your computer
Click the R icon, and then the R command window will pop up
3. Running R program
Command mode: you can run R program by typing statements line by line on R console, or, cut and paste R code from a file to R console
Batch mode: source R code from a file >source("myRcode.R");
To install an R package: type R command >install.packages("packageName"); Load the package when using it by command >library(packageName)
4. Try the following
The command to start a browser interface for help is help(command name). Remember to include "()".
To list or set working directory, use dir() or setwd().
To make a list with integers from 1 to 100 and save it to a variable named as x, try x<-1:100 (here <- indicates assignment)
To generate 1000 numbers from the normal distribution, try y<-rnorm(1000)
To plot the content of variable x, try plot(x)
The command for help on any R command is help(). E.g., the command is rnorm(), then to get help you use command help(rnorm)
The command to list all variables in the working space (treat it as memory), try ls()
To stop the R, simply kill the R command window.