Re: [R] apply loop - using/providing a data frame to loop over

2009-12-28 Thread Daniel Malter
Malter Cc: r-h...@stat.math.ethz.ch Subject: Re: [R] apply loop - using/providing a data frame to loop over Try this. It picks out each string of word characters (\w+) followed by a space followed by a word character: > library(gsubfn) > strapply(authors, "\\w+ \\w", c)[[1]]

Re: [R] apply loop - using/providing a data frame to loop over

2009-12-28 Thread Henrique Dallazuanna
Try this: mapply(substr, x = authors, start = starts, stop = ends) On Mon, Dec 28, 2009 at 10:46 AM, Daniel Malter wrote: > Hi, > > I want to extract individual names from a single string that contains all > names. My problem is not the extraction itself, but the looping over the > extraction st

Re: [R] apply loop - using/providing a data frame to loop over

2009-12-28 Thread Gabor Grothendieck
Try this. It picks out each string of word characters (\w+) followed by a space followed by a word character: > library(gsubfn) > strapply(authors, "\\w+ \\w", c)[[1]] [1] "Schleyer T" "Spallek H" "Butler B""Subramanian S" [5] "Weiss D" "Poythress M" "Rattanathikun P

[R] apply loop - using/providing a data frame to loop over

2009-12-28 Thread Daniel Malter
Hi, I want to extract individual names from a single string that contains all names. My problem is not the extraction itself, but the looping over the extraction start and end points, which I try to realize with apply. #Say, I have a string with names. authors=c("Schleyer T, Spallek H, Butler BS,