Unlike SAS, R has no separation of phases for data modification (data step) and analysis (proc step). It is more like SPSS where as long as you have data read in, you can modify it. Anything that you have read into or created in your R workspace you can modify at any time.
R performs transformations such as adding or subtracting variables on the whole variable at once, as do SAS and SPSS. It calls that vector arithmetic. R has loops, but you do not need them for this type of manipulation.
R can nest one function call within any other. This applies to transformations as well. For example, taking the log of our q4 variable and then getting summary statistics on it, you have a choice of a two-step process like:mydata$q4Log <- log(mydata$q4)summary( mydata$q4Log )
Or you could simply nest the log function within the summary function:summary( log( mydata$q4 ) )
If you planned to do several things with the transformed variable, saving it under a new name would lead to...