Re: [R] Question on Import

From: Jim Lemon <jim_at_bitwrit.com.au>
Date: Mon, 25 Apr 2011 18:52:37 +1000

On 04/25/2011 05:58 PM, Georgina Salazar wrote:
> 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
>
Try

read.delim("ken_data_try_anova")

If that doesn't work, turn off the "Hide extensions for known file types" option in Windows Explorer and find out what the extension for this file is.

> I have another file called 10423nad.txt.
>
> I tried
>> data<-as.matrix(read.table(C:\Users\gtsalazar1979\Documents\TANOVA_1.0.0\10423nad.txt))
>> )
>
> but got the error message
> Error: unexpected input in "data<-as.matrix(read.table(C:\"
>
The single backslash doesn't work as a path delimiter in R. Try:

data<-as.matrix(read.table("C:\\Users\\gtsalazar1979\\Documents\\TANOVA_1.0.0\\10423nad.txt"))

or

data<-as.matrix(read.table("C:/Users/gtsalazar1979/Documents/TANOVA_1.0.0/10423nad.txt"))

That is, replace the backslashes with forward slashes (and don't forget the quotes)

> How do I place the data where the import function can find it? Or, how do I
> correct my use of the import functions?
>

Jim



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. Received on Mon 25 Apr 2011 - 08:57:27 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:00:33 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive