0

When I write a script in RStudio, and run it, it isn't displaying any output. However, if I run the commands directly in console, it's working.

For example, if I have a file called script1.R which has the following code:

r = 5 * 25 * 2
r

When I do

source('~/Desktop/script1.R')

nothing happens. However, if I just type those two lines into console, it's working fine. What can I do to fix this? I have RStudio Version 0.98.1103 and R 3.1.2.

ytk
  • 2,787
  • 4
  • 27
  • 42

1 Answers1

0

You need to do something like View(r). Or like Alexey said print(r).

Also, I would say that it is "bad practice" to use something like r as a variable name. Try something more specific.

Nedinator
  • 1,052
  • 13
  • 24