ADVERTISEMENT

Question for R users.

Op2

Well-Known Member
Mar 16, 2014
7,137
5,614
1
A few weeks ago someone linked here to R resources (or maybe on the main board). Thanks for that. It was useful. I'm in the early stages of trying to learn R.

I am a SAS user now. In SAS you write a program and submit it. The program can be short or long, do a little or a lot, whatever. You type in whatever programming you want into the SAS text editor. Nothing happens until you submit the text, at which time output it is generated in the output window and a record of what you're doing (including error descriptions if any) are generated in the log window.

Okay, now onto R. In R you have a ">" prompt and that's it. So if you type "2 + 5" and hit return at the ">" prompt then you get a new line saying "7." That's it.

I don't understand how any significant programming can be done this way. Do R users really just work in the ">" prompt the entire time? Or do they write programs in a text editor and then copy and paste it into R when they're finished and run that? I also don't see how data management can be done in R. In SAS you work with a dataset. If you have a dataset named X that contains variables A, B and C and you want to make a new dataset Y that has more variables than that then you do this:

data y;
set x;
Q = 2 * A;
ABC_sum = A + B + C;
log_C = ln (C);
run;

Even if you don't know SAS you can easily see what's going on. And you can make it much more complicated than that if you like. But I don't see how you can do any of this with just a ">" prompt. Anyone have any thoughts on this?
 
ADVERTISEMENT
ADVERTISEMENT

Go Big.
Get Premium.

Join Rivals to access this premium section.

  • Say your piece in exclusive fan communities.
  • Unlock Premium news from the largest network of experts.
  • Dominate with stats, athlete data, Rivals250 rankings, and more.
Log in or subscribe today Go Back