Closed HenrikBengtsson closed 9 years ago
@HenrikBengtsson Good idea. You can manage this with something like:
Hastings <- bib_metadata("10.1098/rspb.2013.1372")
and then do citet(Hastings)
afterwards.
Originally I had a mechanism to assign the bibtex key during the call to citet
, but this seemed a bit cumbersome. Lemme know if this work-around will do it for you. If you literally want to use the DOI each time I guess we could look into caching after the first call; might be a good thing to do but caching can always get tricky pretty quickly (e.g. during interactive use).
I like this "pre-fetch" solution where the reference becomes first-class objects in R. It's not hard to imagine using code inspection to validate that all reference variables exists basically directly parsing. This should be less error prone that referring to references by strings, which can only be caught as an error at run time.
EDIT: Forgot to say, yes, this works for me.
(looks like we have a working solution so closing this)
It would be great if citation look ups would be memoized. For instance, if I call
citet("10.1098/rspb.2013.1372")
multiple times, it's only the first one that query online resources, whereas all the following would be pull from the local cache/database.