[R] Cannot read or write to file in Linux Ubuntu

Jeff Newmiller jdnewmil at dcn.davis.CA.us
Thu May 3 18:30:10 CEST 2012


All of your tests are with relative paths. Use getwd() identify your starting directory, and if it isn't you can use setwd() to start in the right place.
---------------------------------------------------------------------------
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil at dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
--------------------------------------------------------------------------- 
Sent from my phone. Please excuse my brevity.

John Kane <jrkrideau at inbox.com> wrote:

>I am the proud owner of a new laptop since my old one died the other
>day.
>Currently I have a dual-boot Windows 7 Home and Ubuntu 12.04 .  I'll
>leave the Windows problems for another post.
>
>I know practically nothing about Linux so I am probably doing something
>stupid but ... at the moment I cannot seem read or write  files in
>Ubuntu.   I am not having any problem saving other documents to the
>hard drive and R , from my few simple tests, seems to be working okay
>otherwise.
>
>At the moment I am trying :
>
>mydata <- read.csv("DATA/media/DATA/rdata/tt1.csv",  header = TRUE)
>  or 
>mydata <- read.csv("DATA/rdata/tt1.csv",  header = TRUE)
>
>
>where tt1.csv is a text file on what, from my reading of the path
>listed  in gedit is 
>DATA/media/DATA/rdata
>
>The csv data is simply:
>aa, bb
>2, 3
>4, 5
>
>What happens:
>-------------------------------------------------------------------------------
>1> mydata <- read.csv("DATA/rdata/tt1.csv",  header = TRUE)
>Error in file(file, "rt") : cannot open the connection
>In addition: Warning message:
>In file(file, "rt") :
>  cannot open file 'DATA/rdata/tt1.csv': No such file or directory
>
>Am I totally screwing up the path?  Or doing something else equally
>stupid?
>
>BTW I realise that 2.15 is out but Ubuntu as of yesterday did not have
>it in the repositories and I have yet to figure out how to install it
>from a CRAN site.
>
>1> sessionInfo()
>R version 2.14.1 (2011-12-22)
>Platform: i686-pc-linux-gnu (32-bit)
>
>locale:
> [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
> [3] LC_TIME=en_CA.UTF-8        LC_COLLATE=en_US.UTF-8    
> [5] LC_MONETARY=en_CA.UTF-8    LC_MESSAGES=en_US.UTF-8   
> [7] LC_PAPER=C                 LC_NAME=C                 
> [9] LC_ADDRESS=C               LC_TELEPHONE=C            
>[11] LC_MEASUREMENT=en_CA.UTF-8 LC_IDENTIFICATION=C       
>
>attached base packages:
>[1] stats     graphics  grDevices utils     datasets  methods   base   
> 
>
>John Kane
>Kingston ON Canada
>
>____________________________________________________________
>FREE 3D EARTH SCREENSAVER - Watch the Earth right on your desktop!
>
>______________________________________________
>R-help at r-project.org mailing list
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide
>http://www.R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list