I have used SAS
for 15 years, and have started using R
seriously the past 6 months, with some tinkering around in it for a couple of years ahead of that. From a programming perspective, R
does data manipulations directly, there is no equivalent to DATA
or PROC SQL
procedures because they're not needed (the latter being more efficient in SAS
when there is a lot of data manipulation to do from external data sources, e.g. administrative data). This means that, now I'm getting the hang of it, data manipulation is faster in R
and requires much less code.
The main issue I have encountered is memory. Not all R packages allow WEIGHT
type specifications, so if you have SAS
datasets with variables used in FREQ
or REPLICATE
statements, you may have issues. I have looked at the ff
and bigmemory
packages in R but they do not appear to be compatible with all R packages, so if you have very large datasets that require analyses that are relatively uncommon, and have been aggregated, you may have issues with memory.
For automation, if you have SAS macros
then you should be able to programme the equivalent in R
and run as batch.
For coding in R
, I was using Notepad++
and setting the language to R
, and am now discovering the joys of R Studio
. Both these products are free, and do language mark up like the improved SAS
syntax GUI (I've only ever used the syntax screen in SAS
).
There is a website, and related book, for people swapping from SAS
to R
. I found them useful for trying to work out how to translate some SAS
commands into R
.
Update: one thing that drove me nuts when coming to R
is that R
doesn't assume everything is a data set (data frame
in R
parlance), because it's not a statistical package in the way that SAS
, SPSS
, Stata
, etc are. So, for example, it took me a while to get if
statements working because I kept getting the help for if
statements with vectors (or maybe matrices) whereas I needed an if
statement that worked with data frames
. So the help pages probably need to be read more closely than you would normally, because you'll need to check that the command you want to do will operate with the data object type you have.
The bit that still drives me crazy when learning a new R
command (e.g. analysis method in a contributed package) is that the help for commands is often not entirely self-contained. I will go to the help page to try to learn the command and the usage notes often have ...
contained in them. Sometimes trying to work out what can or should go where the ...
is has lead me into a recursive loop. The relative brevity of the help notes, coming from SAS
which provides detailed examples of syntax and worked examples with an explanation of the study in the example, was quite a large shock.