Nothing
#internal function
genXtract <-
function(text.var, left, right, with = FALSE, merge = TRUE){
if (length(left) != length(right)) {
stop("left and right must be equal length")
}
specchar <- c(".", "|", "(", ")", "[", "{", "^", "$", "*", "+", "?")
left <- mgsub(specchar, paste0("\\", specchar), left, fixed = TRUE)
right <- mgsub(specchar, paste0("\\", specchar), right, fixed = TRUE)
FUN <- function(left, right, text.var, with){
fmt <- if (with==TRUE) {
"(%s).*?(%s)"
} else {
"(?<=%s).*?(?=%s)"
}
re <- sprintf(fmt, as.character(left), as.character(right))
if(length(text.var)==1){
unlist(regmatches(text.var, gregexpr(re, text.var, perl=TRUE)))
}else{
regmatches(text.var, gregexpr(re, text.var, perl=TRUE))
}
}
out <- invisible(lapply(seq_along(left), function(i) {
FUN(left[i], right[i], text.var = text.var, with = with)
}))
names(out) <- paste(left, " : ", "right")
if (length(left) == 1) {
return(unlist(out, recursive = FALSE))
} else {
if (merge) {
out <- invisible(lapply(seq_along(text.var), function(i) {
unlist(invisible(lapply(seq_along(out), function(j) {
out[[j]][[i]]
})))
}))
}
}
out
}
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.