Downloads article PDF from the famous Sc.-H.b website. The URL of the website must be stored locally as the environment variable SCIHUB_URL in the ~/.Renviron. Use the function usethis::edit_r_environ() to edit this file.

get_pdf(doi, download = TRUE, path = ".", filename = "", overwrite = FALSE)

Arguments

doi

a character of length 1. The DOI of the article.

download

a logical. If TRUE (default) the PDF is downloaded. Otherwise the link to the PDF is returned.

path

a character of length 1. The directory to save PDFs. Must exist.

filename

a character of length 1. The name of PDF (without extension).

overwrite

a logical. If TRUE and the PDF already exist, the PDF will be downloaded again. Default if FALSE.

Value

The PDF link (character of length 1) or NULL (no PDF available).

Examples

if (FALSE) {
doi <- "10.1111/ele.13778"
get_pdf(doi, path = ".", filename = "2022-mouillot-ecolet")
}