Simply type 1+1 at the prompt, and hit enter to see the answer:įor the moment, you can ignore the "" that precedes the answer of "2". Suppose you want R to perform a simple addition problem, like $1 + 1$. While R is well more powerful than a scientific calculator, it can certainly function as one, when desired. Then you get another prompt, and the process starts all over again. Upon typing some command or expression, R produces some response. When you start R (or R Studio), you are presented with a prompt - an invitation to say something to R. You can think of working with R as a conversation. As such, even today, they are frequently the programs of choice for the power users and computer gurus of the world. Text-based programs, on the other hand, generally have a steeper learning curve - but they also offer tremendous flexibility, application, and speed. Instead, they use programs that provide intuitive and easy-to-use graphical user interfaces (GUIs), full of windows, colorful icons, buttons, etc. Indeed, the great masses of computer users rarely run text-based programs anymore. Without an additional integrated development environment (IDE) like R Studio, it doesn't even recognize the mouse!Īn entirely text-based application may seem like a throw-back to the days of old when MS-DOS ruled the world, and Apple and Windows operating systems were still finding their footings. While most all of our efforts will be confined to using R through RStudio, the point of bringing up these other ways of working with R is to emphasize that R, by itself, is entirely text-based. Below is a picture of what working with R inside OS X's "Terminal" program looks like: For those that wish to do so, you can launch and use R with just a simple "Terminal" application under OS X, or the "Windows Subsystem for Linux" under Windows. However, this front end is not a necessity. RStudio provides a nice "front end" for R, adding to the console environment other windows to keep track of files, images, variable values, etc. R is a program designed to run in a terminal or console environment. R Calculations, Variables, and Simple Data Sets The Text-Based Nature of R ![]() R Calculations, Variables, and Simple Data Sets
0 Comments
Leave a Reply. |