[R] Help - Importing data from txt and xlsx files

ONKELINX, Thierry Thierry.ONKELINX at inbo.be
Fri Apr 13 15:09:49 CEST 2012

Dear Tom,

R does not searches your entire file system for the file. It only looks in the working directory. Have a look at ?setwd() and ?getwd()

So you will need to set the working directory, use a relative path to the file or use and absolute path to the file.

Best regards,

ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest
team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance
Kliniekstraat 25
1070 Anderlecht
+ 32 2 525 02 51
+ 32 54 43 61 85
Thierry.Onkelinx op inbo.be

To call in the statistician after the experiment is done may be no more than asking him to perform a post-mortem examination: he may be able to say what the experiment died of.
~ Sir Ronald Aylmer Fisher

The plural of anecdote is not data.
~ Roger Brinner

The combination of some data and an aching desire for an answer does not ensure that a reasonable answer can be extracted from a given body of data.
~ John Tukey

-----Oorspronkelijk bericht-----
Van: r-help-bounces op r-project.org [mailto:r-help-bounces op r-project.org] Namens AMFTom
Verzonden: vrijdag 13 april 2012 14:29
Aan: r-help op r-project.org
Onderwerp: [R] Help - Importing data from txt and xlsx files

Hi all,

I have just started to use R for my PhD project and have no previous
experience in programming. I am having trouble importing data to R.   This
is the output:

> mydata <- read.table("Lv2.8.txt")
Error in file(file, "rt") : cannot open the connection In addition: Warning message:
In file(file, "rt") :
  cannot open file 'Lv2.8.txt': No such file or directory

I know there is a file on my computer with this name though... What am I doing wrong?

Thanks in advance!


View this message in context: http://r.789695.n4.nabble.com/Help-Importing-data-from-txt-and-xlsx-files-tp4554622p4554622.html
Sent from the R help mailing list archive at Nabble.com.

R-help op r-project.org mailing list
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
* * * * * * * * * * * * * D I S C L A I M E R * * * * * * * * * * * * *
Dit bericht en eventuele bijlagen geven enkel de visie van de schrijver weer en binden het INBO onder geen enkel beding, zolang dit bericht niet bevestigd is door een geldig ondertekend document.
The views expressed in this message and any annex are purely those of the writer and may not be regarded as stating an official position of INBO, as long as the message is not confirmed by a duly signed document.

More information about the R-help mailing list