...
save the file (the authomatic file extension will be .Rnw) and try to compile the file ("Compile PDF" button). You should be prompted a PDF: congratulations, this is your first LaTeX file!
Sweave
...
Download the file http://leisch.userweb.mwn.de/Sweave/example-1.Snw and open it in RStudio
http://www.statistik.lmu.de/~leisch/Sweave/Sweave-manual.pdf
...