[R] Read.Table Reading a Text file
Petr Pikal
petr.pikal at precheza.cz
Fri Oct 8 10:38:08 CEST 2004
Hi
you really should spend some time to go through introductory
documentation and do some examples provided.
<snip>
On 8 Oct 2004 at 3:15, Kunal Shetty wrote:
you probably read it by read.table without saying/specifying
header=TRUE so your X and y is included to your data not as
names but as values. Therefore V1 and V2 are factors.
Please consult especially R-intro manual in doc directory. It helps
you to save a lot of frustration and misunderstanding, especially at
the begging of your work with R.
And consider help list as a last source of help as what you have
learned yourself you remember better and you understand better.
Cheers
Petr
> >
> > V1 V2
> > 1 X y
> > 2 8 10
> > 3 11 1 4
> > 4 16 16
> > 5 18 15
> > 6 6 20
> > 7 4 4
> > 8 20 18
> > 9 25 22
> >
> >
> > and I want to access V1 values.....
> >
> >
> > thank you
> > regards
> > Kunal
> >
> >
> > james.holtman at convergys.com wrote:
> > >
> > >
> > >
> > >
> > > If you have an unequal number of columns, then use 'fill=T'
> > > onread.table
> > >
> > > It putsNAs.
> > >
> > > Is this what youwant?
> > >
> > > Here is what happens on the input file which is your data and
> > > someextra
> > >columns:
> > >
> > > 8 10
> > > 11 14
> > > 16 16
> > > 18 15 12
> > > 6 20
> > > 4 4 12
> > > 20 18
> > >
> > >
> > > > x.1 <- read.table('/tempxx.txt',fill=T)
> > > >x.1
> > > X8X10
> > > 11 14 NA
> > > 16 16 NA
> > > 18 15 12
> > > 6 20 NA
> > > 4 4 12
> > > 20 18 NA
> > >__________________________________________________________
> > > James Holtman "What is the problem you are trying tosolve?"
> > > Executive Technical Consultant -- Office of Technology,Convergys
> > >james.holtman at convergys.com
> > > +1 (513)723-2929
> > >
> > >
> > >
> > > KunalShetty
> > > <kshe4 at student.monash To:r-help at stat.math.ethz.ch
> > > .edu>cc:
> > > Sent by: Subject: [R] Read.Table Reading a Textfile
> > >r-help-bounces at stat.m
> > >ath.ethz.ch
> > >
> > >
> > > 10/07/200416:18
> > >
> > >
> > >
> > >
> > >
> > >
> > > Dear R users andHelpers
> > >
> > > I am beginner with using R and interested in carrying out
> > > certaintask
> > >for
> > > my statisticalresearch.
> > > I am reading data for a text file, which could contain data
> > > infollowing
> > >pattern
> > >
> > > x y
> > > 8 10
> > > 11 14
> > > 16 16
> > > 18 15
> > > 6 20
> > > 4 4
> > > 20 18
> > >
> > > As per the example I have two columns and 7 rows of data ineach.
> > > However is real life data situation I may not know how many
> > > columnsare present and how rows are present and also with the
> > > certain datais missing. Yes I am assuming the data is delimited
> > > myTab.
> > >
> > >
> > > My question or rather problem is I want read data from each colum
> > > saycol
> > >x
> > > (8,11,16,18âEURŒ.20) and store it into a variable so that I
> > > couldperform
> > >some
> > > operations onthem.
> > >
> > > I have also looked into certain R-help for Read.table and
> > > data.framebut still struggling on my requirement. Theyare
> > >
> > >http://tolstoy.newcastle.edu.au/R/help/04/07/2040.html
> > >http://tolstoy.newcastle.edu.au/R/help/04/07/3152.html
> > >
> > >
> > >Regards
> > >Kunal
> > >
> > >______________________________________________
> > > R-help at stat.math.ethz.ch mailinglist
> > >https://stat.ethz.ch/mailman/listinfo/r-help
> > > PLEASE do read the postingguide!
> > >http://www.R-project.org/posting-guide.html
> > >
> >
> > ______________________________________________
> > R-help at 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
>
> ______________________________________________
> R-help at 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
Petr Pikal
petr.pikal at precheza.cz
More information about the R-help
mailing list