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

Share:

Description

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

Usage

1
2
3
4
5
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
## 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")

## End(Not run)