R package to interact with the RePEc API.
This package is on CRAN. To install it, type in your R console:
To install the latest version, you can use the
# install.packages('devtools') # If not already installed devtools::install_github('chrMongeau/repec')
You will need to ask for an access code (see link above) that is linked
to a specific IP. The code will be needed when calling most
of the functions by using the
code parameter (see below). One way to
avoid passing explicitly the code is to create the
environment variable. The code below can be put in your
that it is always available when you start R:
# YOURCODE is your personal access code Sys.setenv(REPEC_API_KEY = 'YOURCODE')
The functions generally accept a Short-ID (e.g., pmo915) or a string.
Functions with string
Functions with Short-ID
There is a generic function (
repec_api_with_id) that can be used to call
one of the methods that use a Short-ID and is not yet available in the
repec_api_with_id(id = 'pmo915', method = 'somemethod', code = 'YOURCODE')
In the previous example
somemethod is the name of the method you want
to call (e.g.,
Functions were named according to the API method, but they have underscored
aliases that make them more readable. For instance,
be called as
etc. You probably get the point.
Not all the API methods are available in the package. Unfortunately I have not access to all of them, thus I don't know what they actually do. If you want a function to be added, and know what it returns, please open an issue.