Try as.numeric(sub(".*\\(","", sub('\\)','',aa)))
You may also want to look at regexec/regmatches for a more general approach ... On 02 Mar 2014, at 20:55, Doran, Harold <hdo...@air.org> wrote: > "1 (472)" "2 (445)" "3 (431)" "3 (431)" "5 (415)" "6 (405)" "7 (1) Benno Pütz Statistical Genetics MPI of Psychiatry Kraepelinstr. 2-10 80804 Munich, Germany T: ++49-(0)89-306 22 222 F: ++49-(0)89-306 22 601 [[alternative HTML version deleted]]
______________________________________________ R-help@r-project.org 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.