add_scholar_cites_to_bib: Update citation counts in bib file for references with google...

Description Usage Arguments Details See Also Examples

View source: R/cv.R

Description

This is a rather specific function designed for my (Greg's) CV, based on initial work by James Manton. The idea is that the bib file (probably produced by BibDesk) contains a list of publications with google ids specified in the bibtex field googlescholarid; at present these must all have one single google scholar author (denoted by author_id) as a co-author.

Usage

1
2
add_scholar_cites_to_bib(author_id, bibin, bibout = NULL,
  citekeys = NULL, clean = TRUE, Force = TRUE)

Arguments

author_id

The google scholar author id

bibin, bibout

The input and output bibtex files. bibout defaults to <bibin_stem>_scholarcites.bib

citekeys

An optional vector specifying a subset of citekeys to use.

clean

Whether to remove difficult fields / clean up input file

Force

Whether to insist on updating the output file (see RunCmdForNewerInput)

Details

The function first cleans up the input bib file by removing long, irrelevant fields. It then fetches the publication list from google scholar for the specified author_id using get_publications ( which returns a data.frame including the scholar publication ids and citation counts). This information is then merge with the bibtex file and new/updated citation counts are placed in the bibtex field citationnum.

By default the output is written to a new bibtex file called <bibin_stem>_scholarcites.bib. Note that this process is lossy since some fields are dropped and therefore it is not recommended to overwrite the original input file.

See Also

RunCmdForNewerInput, get_publications

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## Not run: 
add_scholar_cites_to_bib("cuXoCA8AAAAJ", 'mypubs.bib')

f="~/Greg/ProfessionalAdmin/cv_lyx/JefferisPublications.bib"
bdsk_groups=read_bibdesk_static_groups(f)
add_scholar_cites_to_bib("cuXoCA8AAAAJ", f, citekeys=bdsk_groups$SelectedCandidates)

## a sample rmarkdown chunk:
# nb the block should have options like:
# ```r bibstuff, echo=FALSE, results="hide", message=FALSE, warning=FALSE```
# to avoid potentially distracting messages.
library(paperutils)
add_scholar_cites_to_bib("cuXoCA8AAAAJ", "~/cv/JefferisPublications.bib")
# produces "~/cv/JefferisPublications_scholarcites.bib"

library(scholar)
gs_prof=get_profile("cuXoCA8AAAAJ")

## End(Not run)

jefferis/paperutils documentation built on Sept. 20, 2019, 10:20 a.m.