News for hackers. Stuff that matters.
Re:Introduction to R Programming by phillc73 on Thursday December 07, 2017 @05:25AM (#15868946)
I think you need to reference the data files from the working directory, not the directory where the script currently is. The two aren't necessarily the same.

The current working directory can be found with getwd() and set with setwd().

If you set the working directory at the beginning of the script, paths to data files should be relative to that location.

Re:Introduction to R Programming by roel_v on Thursday December 07, 2017 @05:36AM (#15868976)
Yes but for example when running from within RStudio, or calling from other scripts, the two aren't the same. Calling from other scripts you can do chdir() first of course, but my point is that you can't sensibly rely in your script on cd and script path to be the same.