Skip to content

Conversation

LukasWallrich
Copy link
Contributor

Description

This adds an option to use a cache for cr_cn (and an approach that could easily be generalised to other request functions). The cache only persists for a single session - yet at least in my use case, that is the most relevant constraint to ensure that (e.g.) functions that fail half-way do not need to repeat requests.

It notionally adds a new dependency (rlang) but that is already required by dplyr etc anyway.

Related Issue

This does not go quite as far as #185 but might be a light-weight first step?

Example

cr_cn(dois = "10.1126/science.169.3946.635", format = "citeproc-json", cache = TRUE)

behaviour unchanged on first call, much faster from second call onward.

@njahn82 njahn82 merged commit bf3fcfe into ropensci:main Mar 17, 2023
@njahn82
Copy link
Member

njahn82 commented Mar 17, 2023

Thank you for your contribution, it looks good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants