Bibtex Usage
Prerequisites
R
R package 'bibtex'
Any reference management software/website that could generate a bibtex file describing your references
Procedures
Get the bibtex file from your reference management software/website.
Enter R and load the 'bibtex' package.
Assuming that the file name is “ReferenceList.bib” and is located under the current working directory, enter the following codes to read and parse bibtex file:
bibentry.list <- read.bib(file="ReferenceList.bib")
Now you could do various statistics on your reference list!
Statistics
Statistics | Result format | Comment |
All author names | Character vector, each element of which is the full name for an author, with the given names coming first and the family name second | If you'd like to change how the name is presented, feed additional parameters to the function 'format' |
authorperref.list <- bibentry.list$author
unlist(lapply(authorperref.list, format))
Statistics | Result format | Comment |
Authors that contribute to at least 3 of these references | A sorted table result describing authors matching the criteria | If an author occurs n (n>1) times in a reference(this could happen if the “authors” of this reference are defined as all authors belonging to several communities/organizations which might have overlaps with respect to their staff), he/she will still be considered contributing to 1 reference; if you want to change this to “n references”, skip 'lapply'-ing the 'unique' function on 'authornameperref.list'. |
- snippet.r
authorperref.list <- bibentry.list$author
authornameperref.list <- lapply(authorperref.list, format)
##Some authors will occur in the paper more than once
authornameuniqueperref.list <- lapply(authornameperref.list, unique)
##
authors.vector <- unlist(authornameuniqueperref.list)
authors.table <- table(authors.vector)
sort(authors.table[which(authors.table >= 3)], decreasing=FALSE)