[R] Substring and strsplit
jholtman at gmail.com
Wed Aug 30 00:29:51 CEST 2006
Use '' as parameter to strsplit
> x3 <- 'dog'
> strsplit(x3, '')
 "d" "o" "g"
On 8/29/06, Erin Hodgess <hodgess at gator.dt.uh.edu> wrote:
> Dear R People:
> I am trying to split a character vector into a set of individual
> 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)
>  "dog"
> I know that this is incredibly simple, but what am I doing wrong?
> Either Windows or Linux 2.3.1
> Thanks in advance!
> Erin Hodgess
> Associate Professor
> Department of Computer and Mathematical Sciences
> University of Houston - Downtown
> mailto: hodgess at gator.uhd.edu
> R-help at stat.math.ethz.ch mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
+1 513 646 9390
What is the problem you are trying to solve?
More information about the R-help