[R] R looks for a folder not specified

Jim Lemon jim at bitwrit.com.au
Mon Jan 17 08:59:24 CET 2011


On 01/17/2011 01:31 PM, l.chhay wrote:
>
> Dear R community,
>
> I have been getting this warning message after running a function sourced
> from an R script, and can't seem to work out why R is looking for a folder
> that wasn't even specified (it attaches a \NA to the specified directory,
> where assess_rev has not asked to do so at all. R code has been tested by
> another user and that works fine).
>
> I have tried saving the files in a new folder and onto a different drive,
> but that doesn't seem to fix the problem.. I have also checked to make sure
> that I've the appropriate access options.
>
> Has anyone encountered this problem where R starts looking for this
> non-existent \NA folder?
>
>> source("S:\\research\\boxcox\\Series_to_experiment_with\\Revisions_analysis\\assess_rev3.R")
>> assess_rev(data.dir="S:\\research\\boxcox\\Series_to_experiment_with\\Revisions_analysis\\NEPAL_JUL81_B1\\lam0\\",rev.lag=13,series="NEPAL_JUL81_B1",comp="adj")
> Error in file(file, "r") : cannot open the connection
> In addition: Warning message:
> In file(file, "r") :
>    cannot open file
> 'S:\research\boxcox\Series_to_experiment_with\Revisions_analysis\NEPAL_JUL81_B1\lam0\NA':
> No such file or directory
>
Hi Leanne,
I thought it was the line break in the directory string, but the line 
wasn't broken when I started to answer. My next guess is that you don't 
need the trailing "\\" on the directory string.

Jim



More information about the R-help mailing list