Re: [R] sscanf

2009-05-08 Thread jim holtman
You can always use regular expressions: > x <- "Condition: 311" > as.integer(sub(".*?(\\d +).*", "\\1 ", x, perl=TRUE)) [1] 311 > On Fri, May 8, 2009 at 10:16 AM, Matthias Gondan wrote: > Dear list, > > Apparently, there is no function like sscanf in R. > > I have a string, "Condition: 311", an

[R] sscanf

2009-05-08 Thread Matthias Gondan
Dear list, Apparently, there is no function like sscanf in R. I have a string, "Condition: 311", and I would like to read out the number and store it to a numeric variable. Is there an easy way to do this? Best wishes, Matthias -- __ R-help@r-project