Re: [R] problem with read.table

From: Don MacQueen <macq_at_llnl.gov>
Date: Fri 26 Aug 2005 - 00:49:45 EST

  Potential helpers need more information.

Type:

    head(a)

and

    str(a)

and post the results.

Compare with the output of the same commands on a dataframe that does have this problem.

-Don

At 5:01 PM +0530 8/25/05, Krishna wrote:
>Hi Mr. Pedro
>
>I tried names(a) and it displayed the names as X, Y and Z.
>
>rgds
>
>snvk
>
>On 8/25/05, Pedro J. Aphalo <pedro.aphalo@cc.jyu.fi> wrote:
>> Hi,
>>
>> Did you try names(a) so see what are the names of the columns in the
>> dataframe?
>>
>> Hope this helps a little.
>>
>> Pedro.
>>
>> Krishna wrote:
>> > Hi All
>> >
>> > recently i faced an unknown problem while reading the data. Can
>> > someone help me in understanding why this happened.
>> >
>> > I have .txt file containing X, Y, Z variables. I used the command
>> >
>> >
>> >>a <- read.table("filename", header=TRUE)
>> >
>> > after reading the file i am able to view it by tryping a. but i am
>> > unable to access the variables in a, by giving the command a$X.
>> >
>> >
>> >>a$X
>> >>NULL
>> >
>> >
>> > this is the output it was showing. However the same i am able to
>> > access by giving a[[1]]. i tried changing the mode by issuing command
>> > a <- as.data.frame(a). But situation remains the same.
>> >
>> > look forward for experts suggestion on this.
>> >
>> > rgds
>> >
>> > snvk
>> >
>> > ______________________________________________
>> > R-help@stat.math.ethz.ch mailing list
>> > https://stat.ethz.ch/mailman/listinfo/r-help
>> > PLEASE do read the posting guide!
>>http://www.R-project.org/posting-guide.html
>>
>>
>> --
>> ==================================================================
>> Pedro J. Aphalo
>> Department of Biological and Environmental Science
>> University of Jyväskylä
>> P.O. Box 35, 40351 JYVÄSKYLÄ, Finland
>> Phone +358 14 260 2339
>> Mobile +358 50 3721504
>> Fax +358 14 260 2321
>> mailto:pedro.aphalo@cc.jyu.fi
>> http://www.jyu.fi/~aphalo/ ,,,^..^,,,
>> ==================================================================
>>
>>
>
>______________________________________________
>R-help@stat.math.ethz.ch mailing list
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

-- 
--------------------------------------
Don MacQueen
Environmental Protection Department
Lawrence Livermore National Laboratory
Livermore, CA, USA

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Fri Aug 26 00:55:37 2005

This archive was generated by hypermail 2.1.8 : Sun 23 Oct 2005 - 15:51:27 EST