4.1 Basic Calculator

R can do many different tasks from the very complicated to the very simple. At a very basic level, we can use R as a calculator.

The character ‘>’ (or ‘ready’ prompt) at the far left in the R Console Window indicates that R is ready for you to enter a command.

In the Console window of RStudio, type 4 + 9 at the ‘>’ prompt.

4 + 9

You can make the function more complicated by taking the square root of the sum:

sqrt(4 + 9)

When you enter this command, the result is displayed. With the Basic Calculator approach, the input and the results are not stored in the workspace. If they are needed again, you would need to re-enter the information.