# NOT RUN {
# put a file in the cache in case there aren't any
dir <- file.path(tempdir(), "testing")
dir.create(dir)
file <- system.file("examples", "elife.xml", package = "fulltext")
writeLines(readLines(file), tempfile(tmpdir = dir, fileext = ".xml"))
# call as.ft_data
x <- as.ft_data(path = dir)
# output lives underneath a special list index "cached"
# representing already present files
x$cached
# }
# NOT RUN {
# collect chunks
if (requireNamespace("pubchunks")) {
library(pubchunks)
res <- ft_collect(x)
pub_chunks(res, c("doi", "title")) %>% pub_tabularize()
}
# }
Run the code above in your browser using DataLab