Thank you guys, both solutions work great! Seems I have two new
packages to investigate :)
Regards,
Tony Breyal
On 31 Mar, 14:20, Tony B wrote:
> Dear all,
>
> Lets say I have the following:
>
> > x <- c("Eve: Going to try something new today...", "Adam: Hey @Eve, how are
> > you finding R? #rs
On Wed, Mar 31, 2010 at 8:20 AM, Tony B wrote:
> Dear all,
>
> Lets say I have the following:
>
>> x <- c("Eve: Going to try something new today...", "Adam: Hey @Eve, how are
>> you finding R? #rstats", "Eve: @Adam, It's awesome, so much better at
>> statistics that #Excel ever was! @Cain & @Abl
strapply in gsubfn can extract matches based on content which seems to
be what you want:
library(gsubfn)
f <- function(...) sapply(list(...), paste, collapse = ", ")
DF <- data.frame(x,
Source = strapply(x, "^(\\w+):", c, simplify = f),
Mentions = strapply(x, "@(\\w+)", c, simpli
Dear all,
Lets say I have the following:
> x <- c("Eve: Going to try something new today...", "Adam: Hey @Eve, how are
> you finding R? #rstats", "Eve: @Adam, It's awesome, so much better at
> statistics that #Excel ever was! @Cain & @Able disagree though :(", "Adam:
> @Eve I'm sure they'll so
4 matches
Mail list logo