Это у вас работает?
yourFunction <- function(x) {
rtf <- read_rtf(x, verbose = FALSE, row_start = "*| ", row_end = "",
cell_end = " | ", ignore_tables = FALSE, check_file = TRUE)
text <- unlist(strsplit(rtf, "\\."))
toMatch <- c("bitcoin", "fund")
matches <- unique(grep(paste(toMatch,collapse="|"),
text, value=TRUE))
matches <- data.frame(matches)
}
results = lapply(files, function(x){
tryCatch(yourFunction(x),
error = function(e)print(paste(x, 'did not want')),
finally = 0)})