[R-sig-ME] read.csv: uploading files

Peter Dalgaard p.dalgaard at biostat.ku.dk
Mon Mar 24 23:18:11 CET 2008


Alex Fajardo wrote:
> To whom it may concern,
> please, help me out.
> I am learning how to proceed with mixed-effects models analysis and
> downloaded the last R version, R-2.6.2., which comes with "lme4" package.
> However, I have a simple problem to upload my file. With older versions I
> import files via the "read.csv" command, like:
> SLA <- read.csv("SLA.csv")
>
> but now it doesn't recognize the file at all:
>
>   
>> SLA = read.csv("SLA.csv")
>>     
> *Error in file(file, "r") : unable to open connection
> In addition: Warning message:
> In file(file, "r") :
> cannot open file 'SLA.csv', reason 'No such file or directory'
> *
> It seems to me I need to save the file somewhere else and not just at the "
> R-2.6.2" directory.
> I will appreciate your help. Cheers,
>
>   
You ensure that the file is in the CURRENT directory, as always.

Now, the default for that has changed, because the install directory was 
not writable for some installs, and dumping random files there was never 
a good idea. To find out where the current directory is, type getwd(), 
to change it, use setwd() or "File/Change dir" from the menu.

Or, of course, you can give the complete path to the file. If you don't 
know what it is, file.choose() is your friend.

-- 
   O__  ---- Peter Dalgaard             Øster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark      Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)              FAX: (+45) 35327907




More information about the R-sig-mixed-models mailing list