kwb.orcid 0.1.0.9000
  • Reference
  • Articles
    • Tutorial
  • Changelog

Tutorial

Michael Rustler

2018-12-19

Source: vignettes/tutorial.Rmd
tutorial.Rmd

1 Install R Packages

First you need to install the following required R packages:

installed_packages <- rownames(installed.packages())

### For installing an R package from Github
if(!"devtools" %in% installed_packages) {
  install.packages("devtools", repos = "https://cloud.r-project.org")
}
### R package for checking ORCID use at KWB
if(!"kwb.orcid" %in% installed_packages) {
  devtools::install_github("KWB-R/kwb.orcid")
}

2 Check ORCID Use

2.1 Authenticate

Either check in interactively with rorcid::orcid_auth() (opens) or provide a valid orcid_token

### If no "orcid_token" is specified in: 
### Sys.setenv("orcid_token" = "my_secret_orcid_token")
### it opens up the web browser for login to ORCID in order to create a 
### authentication token
rorcid::orcid_auth()

### After finishing this step the token is printed to the console, e.g.
> "Bearer my_secret_orcid_token"



### To make this token available in the next R session make sure to set the
### token via Sys.setenv() as shown below
Sys.setenv("orcid_token" = "my_secret_orcid_token")

2.2 Get names and url for all ORCIDs


### Data frame with ORCIDs currently used at KWB
orcids <- kwb.orcid::get_kwb_orcids()

orcids

authors <- kwb.orcid::get_author_meta_for_orcids(orcids)

2.3 Get publications for all ORCIDs

publications <- kwb.orcid::create_publications_df_for_orcids(orcids)
head(publications)

Contents

  • 1 Install R Packages
  • 2 Check ORCID Use
    • 2.1 Authenticate
    • 2.2 Get names and url for all ORCIDs
    • 2.3 Get publications for all ORCIDs

Developed by Michael Rustler.

Site built with pkgdown 1.3.0.