Skip to content

splitting a string / finding a numeric value within a string

3 messages · Jörg Groß, Jorge Ivan Velez, Gabor Grothendieck

#
The first one replaces non-numerics with the empty string
and the second one returns numerics directly:

gsub("[^0-9]", "", "test_01.log")

# or
library(gsubfn)
strapply("test_01.log", "[0-9]+")[[1]]
On Fri, Jan 16, 2009 at 11:00 PM, J?rg Gro? <joerg at licht-malerei.de> wrote: