Data with no separator

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Data with no separator

Jeffrey T. Steedle
I have data in which each row consists of a long string of number,
letters, symbols, and blank spaces.  I would like to simply scan in
strings of length 426, but R takes the spaces that occur in the data as
separators.  Is there any way around this?

Thanks,
Jeff Steedle

--
Jeffrey T. Steedle ([hidden email])
Psychological Studies in Education
Stanford University School of Education

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: Data with no separator

Ted.Harding
On 12-Jan-06 Jeffrey T. Steedle wrote:
> I have data in which each row consists of a long string of number,
> letters, symbols, and blank spaces.  I would like to simply scan in
> strings of length 426, but R takes the spaces that occur in the data as
> separators.  Is there any way around this?
>
> Thanks,
> Jeff Steedle

You could use readLines(), perhaps?

  Data<-readLines("datafile")

should give you a vector Data of which each element is a
character string which is one line read from your datafile.

Best wishes,
Ted.

--------------------------------------------------------------------
E-Mail: (Ted Harding) <[hidden email]>
Fax-to-email: +44 (0)870 094 0861
Date: 12-Jan-06                                       Time: 22:46:39
------------------------------ XFMail ------------------------------

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: Data with no separator

Liaw, Andy
In reply to this post by Jeffrey T. Steedle
Perhaps read.fwf() can be of use...

Andy

From: Jeffrey T. Steedle

>
> I have data in which each row consists of a long string of number,
> letters, symbols, and blank spaces.  I would like to simply scan in
> strings of length 426, but R takes the spaces that occur in
> the data as
> separators.  Is there any way around this?
>
> Thanks,
> Jeff Steedle
>
> --
> Jeffrey T. Steedle ([hidden email])
> Psychological Studies in Education
> Stanford University School of Education
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html
>
>

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html