Suppose I have a character vector as follows:

> aa
[1] "1 (472)" "2 (445)" "3 (431)" "3 (431)" "5 (415)" "6 (405)" "7 (1)”

I want to extract the values within parentheses and place them into a column that is numeric. The values in aa vary in length and so using strsplit() won’t work because the positions change. Is there are better pattern matching function that I can use to grab values from within the parentheses?


	[[alternative HTML version deleted]]

