Re: [R] spliting a string

From: Jim Lemon <jim_at_bitwrit.com.au>
Date: Thu, 17 Jul 2008 22:44:32 +1000

On Thu, 2008-07-17 at 17:56 +0530, Kurapati, Ravichandra (Ravichandra) wrote:
> Hi
>
>
>
> String<-"130.5"
>
>
>
> Df<-Strsplit(".",":",String)
>
>
>
> Then Df get
>
> "" "" "" ""
>
> But I want Df should contains
>
>
>
> Df
>
> "130"
>
> "5"
>
Hi Ravichandra,
Try:

strsplit(String,"[.]")

The period (full stop) has to be marked as literal.

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 Thu 17 Jul 2008 - 12:46:25 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 Thu 17 Jul 2008 - 13:31:52 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