Re: [R] Question on Import

From: Alexander Engelhardt <>
Date: Mon, 25 Apr 2011 10:53:26 +0200

Am 25.04.2011 09:58, schrieb Georgina Salazar:
> Hi!
> I have the data in a tab delimited text file titled "ken_data_try_anova." I
> tried to import it into R entering
>> read.delim(ken_data_try_anova)
> but received the error message
> Error in read.table(file = file, header = header, sep = sep, quote = quote, :
> object 'ken_data_try_anova' not found
> I have another file called 10423nad.txt.
> I tried
>> data<-as.matrix(read.table(C:\Users\gtsalazar1979\Documents\TANOVA_1.0.0\10423nad.txt))
>> )

You shall escape filenames with quotes:

Otherwise R thinks you have a variable named ken_data_try_anova. But you need a string containing the filename (and the difference between strings and variables are the quotes).
The following, for example, would also work:

derp <- "ken_data_try_anova"

What you also want to do, is not only read the table, but also store it in a data frame:

mydata <- read.delim("ken_data_try_anova")

Have fun,
  Alex mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Mon 25 Apr 2011 - 08:58:15 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 25 Apr 2011 - 09:50:32 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive