R-Guru Resource Hub |
This section discusses the similarities and differences between SAS and R. While most everything from SAS can be replicated in R, there is a steep learning curve since R concepts and process flow are more object oriented. R has meanings for special characters such as [], {} and () for example. In addition, most of R syntax consists of functions which are similar to SAS functions and macro programs. So, knowing how to call SAS functions and macros will help to understand, write and execute R functions. Like SAS macro programs, R functions can have positional, keyword and default parameters. See list of R packages install in SAS LSAF.
Few SAS and similar R terms are listed below.
disk storage memory storage
left join, right join, inner join, full outer join left_join(), right_join(), inner_join(), full_join()
min, max, mean, sum, median, std min, max, mean, sum, median, sd
lowcase() tolower()
tranwrd() str_replace_all()
find() str_detect()
catx() paste()
R has SQL query components that enable filter records, subset variables and summary processing. Finally, R processes functions as a collection of independent sequence of steps. So, for example, variables can be created one-by-one with left variable assignments or combined when wrapped in a R function.
Reach for R Low Hanging Fruit for Faster Results
From SAS to R Results Workshop: Derivations, Queries and Joins (R-Guru Cheat Sheet)
From SAS to R Results Workshop: Summary Tables (R-Guru Cheat Sheet)