Some basics Editing:
It is vital that you use a good editor for R --- debugging your programs will be a nightmare otherwise. I believe emacs is the best way to do this, plus you may only want to use ESS, which is a great environment for you to run and debug your R programs. Here is the relevant information:
For help on this go to ESS (emacs speaks statistics)
OR ESS (emacs speaks statistics) within the R project website though John Fox's guide may be a good starting point.
For Windows: R for Windows Frequently Asked Questions
For Mac OSX, things are easiest: Simply download and use Aquamacs from: here . Remember to name your R files with the extension .R so ESS understands that you are typing R code.