Learn R Programming

fulltext (version 0.1.8)

cache: Cache blobs of json, xml or pdfs of text from ft_get() function

Description

Cache blobs of json, xml or pdfs of text from ft_get() function

Usage

cache_options_set(cache = TRUE, backend = "rds", path = "~/.fulltext")

cache_options_get()

cache_clear(cachetype = NULL)

Arguments

cache

(logical) If TRUE, cache results, if not objects saved within R session.

backend

(character) One of rds, rcache, redis

path

path to local storage. used only if backend="rds"

cachetype

The cache type

Examples

Run this code
# NOT RUN {
ft_get('10.1371/journal.pone.0086169', from='plos', cache=FALSE)
ft_get('10.1371/journal.pone.0086169', from='plos', cache=TRUE)

cache_options_set(backend="redis")
cache_options_get()
(x <- ft_get('10.1371/journal.pone.0086169', from='plos', cache=TRUE, backend="redis"))
x %>% collect()

cache_options_set(backend="rcache")
cache_options_get()
(x <- ft_get('10.1371/journal.pone.0086169', from='plos'))
x %>% collect()

# Many different sources
(res <- ft_search(query='ecology', from='entrez'))
cache_options_set(backend="rds")
out <- ft_get(res)
out$entrez
out %>% collect() %>% chunks("title")
# }

Run the code above in your browser using DataLab