The R Project SVN R

Rev

Rev 85065 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 85065 Rev 88252
Line 121... Line 121...
121
    list(sprintf("<\%d>", 1:5))
121
    list(sprintf("<\%d>", 1:5))
122
z
122
z
123
 
123
 
124
## With `perl = TRUE` and `invert = FALSE` capture group names
124
## With `perl = TRUE` and `invert = FALSE` capture group names
125
## are preserved.  Collect functions and arguments in calls:
125
## are preserved.  Collect functions and arguments in calls:
126
NEWS <- head(readLines(file.path(R.home(), 'doc', 'NEWS.2')), 100)
126
NEWS <- head(readLines(file.path(R.home("doc"), "NEWS.2")), 100)
127
m <- gregexec("(?<fun>\\\\w+)\\\\((?<args>[^)]*)\\\\)", NEWS, perl = TRUE)
127
m <- gregexec("(?<fun>\\\\w+)\\\\((?<args>[^)]*)\\\\)", NEWS, perl = TRUE)
128
y <- regmatches(NEWS, m)
128
y <- regmatches(NEWS, m)
129
y[[16]]
129
y[[16]]
130
## Make tabular, adding original line numbers
130
## Make tabular, adding original line numbers
131
mdat <- as.data.frame(t(do.call(cbind, y)))
131
mdat <- as.data.frame(t(do.call(cbind, y)))