Re: [R] Substring and strsplit

From: Thomas Lumley <tlumley_at_u.washington.edu>
Date: Wed 30 Aug 2006 - 08:29:50 EST

On Tue, 29 Aug 2006, Erin Hodgess wrote:

> Dear R People:
>
> I am trying to split a character vector into a set of individual
> letters:
>
> Ideal:
> x3 <- c("dog")
> "d" "o" "g"
>
> I tried the following:
>> strsplit(x3)
> Error in strsplit(x3) : argument "split" is missing, with no default
>> strsplit(x3,1)
> [[1]]
> [1] "dog"
>
> I know that this is incredibly simple, but what am I doing wrong?
>

This is the first example on the help page for strsplit.

         -thomas



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 and provide commented, minimal, self-contained, reproducible code. Received on Wed Aug 30 08:33:31 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 30 Aug 2006 - 10:26:14 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.