I wonder how to use macros in R.
I´m looking for a simple macro so I only need to change for example a date once in a syntax and not on every place where the date is used in the syntax.
In other words like the %let functions in SAS but in R.
I wonder how to use macros in R.
I´m looking for a simple macro so I only need to change for example a date once in a syntax and not on every place where the date is used in the syntax.
In other words like the %let functions in SAS but in R.
a closerlook would suggest that creating your own custom function in R and then calling that function would be like a SAS Macro
e.g
myfunction=function(x){ whatever the macro would do pseduo code}
and then call the function
myfunction(var1)
for %let which is a global variable just assign the value to a constant
but overall quit thinking like SAS and switch to object oriented programming in R