[R] splitting a string up

Stephan Kolassa Stephan.Kolassa at gmx.de
Fri Aug 21 22:08:03 CEST 2009


strsplit("1041281__2009_08_20_.lev", split="_")[[1]][1]

HTH,
Stephan

stephen sefick schrieb:
> x <- "1041281__2009_08_20_.lev"
> 
> I would like to split this string up and only extract the leading numbers.
> 
> 1041281
> 
> to use as a label for a data column in a bigger for loop function to
> read in data.
> regards,
>




More information about the R-help mailing list