0

I am trying to run a R script on Linux using Rscript command. However, it gives me an error stating that no such file or directory.

enter image description here

Weirdly, when I use command "less" on that R script, it works and displays the script on the screen. Can anyone explaining this to me ?

Truong Nhat Minh
  • 207
  • 2
  • 10
  • 1
    If you need help with code you should show the code that's causing the problem with a [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example). Right now we have no idea exactly what you are running so it's impossible to say what's going on. – MrFlick Nov 08 '17 at 16:40
  • Hi, I just want to execute the R script on Linux. When I type Rscript file.R. It says that there is no such file. I have already checked files available in the folder using "ls", and the file is actually there. I also tried to type less file.R, and it has no problem displaying the code on the screen. It means that for other commands, they detect the file in the folder – Truong Nhat Minh Nov 08 '17 at 16:40
  • What exactly are you typing on the command like to try to run the script? Is the error an OS error or an R error? It would be helpful to be more clear about exactly what you are typing/seeing. – MrFlick Nov 08 '17 at 16:50
  • Hi, I just edited my post with the command that I used – Truong Nhat Minh Nov 08 '17 at 16:57
  • The Rscript worked before the `ssmuse-sh` line. What does that line do on your system. Is the `which Rscript` different before and after? Seems like it points to a botched R install after you run that line. – MrFlick Nov 08 '17 at 18:25
  • Since I don't have permission to install any R library on the system. I only can use the available R library on the system. ssmuse-sh directs me to that library. The which Rscript is indeed different before and after – Truong Nhat Minh Nov 08 '17 at 19:25
  • Then I would contact your systems administrator for help. Sounds like the file was not installed correctly. – MrFlick Nov 08 '17 at 19:29
  • Duplicate of: https://stackoverflow.com/questions/39832110/rscript-execution-error-no-such-file-or-directory – MrFlick Nov 08 '17 at 19:29

0 Answers0