Hello,
Try this:
string = "\t\t\t\t\t<span class=\"compliment-count profile\">11</span>"
gsub(".*(11).*","\\1",string)
#[1] "11"
A.K.
----- Original Message -----
From: Shelby McIntyre <[email protected]>
To: [email protected]
Cc:
Sent: Monday, July 30, 2012 8:19 PM
Subject: [R] How can I parse this string to extract just the number 11?
Below is the string to parse and return the embedded number = "11"
string = "\t\t\t\t\t<span class=\"compliment-count profile\">11</span>"
On Jul 29, 2012, at 3:00 AM, [email protected] wrote:
> char
[[alternative HTML version deleted]]
______________________________________________
[email protected] 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.
______________________________________________
[email protected] 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.