Dear Dr. Martyn, Matt and Donovan,
Thanks for your comments. Finally, I could do it.
Best of luck
Priyantha
On 8/29/07, Carl Donovan <[log in to unmask]> wrote:
>
> Hi.
> use:
> Data<- scan(file='text.txt', what='character')
>
> regards
> C
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Dr. Carl Donovan
> Lecturer in Statistics
> School of Mathematics and Statistics
> Centre for Research into Ecological
> and Environmental Modelling (CREEM)
> The Observatory
> Buchanan Gardens
> University of St Andrews
> St Andrews
> Fife
> KY16 9LZ
> Scotland
> +44 1334 461802
>
>
>
> Priyantha Wijayatunga wrote:
> > Dear all,
> >
> > Does anyone know how to read text file into R system so that each
> character
> > of the lines in the text can be separated; for example,
> >
> > The text is
> >
> > text.txt
> > PF00001: YA002 YA003
> > PF00003: YA001 YA005 YA007
> > PF00007: YA008
> >
> > I tried with "readLines" function as
> >
> > rl <- readLines( arguments )
> > then rl[1] will be a character variable of length 1 containing the whole
> > first line of the text, meaning that I cannot separate three words
> (values)
> > there
> >
> > Your help will be greatly appreciated
> >
> > Thanks.
> >
> > Priyantha Wijayatunga
> > Japan
> >
> >
> >
>
|