Skip to content

Instantly share code, notes, and snippets.

@Martin-Jung
Last active December 15, 2015 00:16
Show Gist options
  • Save Martin-Jung/372cafdefdd12b17be1d to your computer and use it in GitHub Desktop.
Save Martin-Jung/372cafdefdd12b17be1d to your computer and use it in GitHub Desktop.
Calculate average altmetric
# MJ 14/12/2015
#### Load or install packages ####
if(!require(devtools))install.packages("devtools");library(devtools)
if(!require(rAltmetric))install.packages("rAltmetric");library(rAltmetric)
if(!require(plyr))install.packages("plyr");library(plyr)
if(!require(ggplot2))install.packages("ggplot2");library(ggplot2)
# This script expects a csv file with title / year / journal / doi
refs <- read.csv("ScharlemannlabPublications.csv",header = T,stringsAsFactors = F)
tot_r <- data.frame()
#### - Calculate average group altmetric - ####
alt <- subset(refs,DOI!="") # Kickout those studies with empty DOI. Altmetric needs an identifier
a <- with(alt,lapply(DOI,function(x) altmetrics(doi = x))) # Get altmetric objects for all refs with a DOI
alt_df <- ldply(a, altmetric_data)
# Average altmetric score + SD
tot_r <- rbind(tot_r,
data.frame(Metric = "Altmetric",
avg = mean(alt_df$score,na.rm = T),
sd = sd(alt_df$score,na.rm = T)))
# Make a quick plot
alt$Score <- alt_df$score;alt$Year <- as.factor(alt$Year)
qplot(Year,Score,data=alt,geom=c("boxplot", "jitter"),fill=Year,main = "Altmetric score") + theme_classic()
tot_r
Title Year Journal DOI
Trade of threatened vultures and other raptors for fetish and bushmeat in West and Central Africa 2015 Oryx 10.1017/S0030605315000514
Implications of energy production for global water resources 2015 Proceedings of the National Academy of Sciences 10.1073/pnas.1507701112
Integrating modelling of biodiversity composition and ecosystem function 2015 Oikos 10.1111/oik.02792
LecoS - A python plugin for automated landscape ecology analysis 2016 Ecological Informatics 10.1016/j.ecoinf.2015.11.006
Shortfalls and solutions for meeting national and global conservation area targets 2015 Conservation letters 10.1111/conl.12158
Riparian reserves within oil palm plantations conserve logged forest leaf litter ant communities and maintain associated scavenging rates 2015 Journal of Applied Ecology 10.1111/1365-2664.12371
Indicators for wild animal offtake: methods and case study for African mammals and birds 2015 Ecology & Society 10.5751/ES-07823-200340
A global map to aid the identification and screening of critical habitat for marine industries 2015 Marine Policy 10.1016/j.marpol.2014.11.007
Global land-use impacts on local terrestrial biodiversity. 2015 Nature 10.1038/nature14324
Synthesising bushmeat research effort in West and Central Africa: a new regional database 2015 Biological Conservation 10.1016/j.biocon.2014.11.001
A transparent process for 'evidence-informed' policy making 2014 Conservation letters 10.1111/conl.12046
Integrated assessment models for ecologists: the present and the future. 2014 Global Ecology and Biogeography 10.1111/geb.12100
Emergent global patterns of ecosystem structure and function from a mechanistic General Ecosystem Model 2014 PLoS Biology 10.1371/journal.pbio.1001841
The PREDICTS database: a global database of how local terrestrial biodiversity responds to human impacts 2014 Ecology and Evolution 10.1002/ece3.1303
Interacting regional scale regime shifts for biodiversity and ecosystem services 2014 BioScience 10.1093/biosci/biu093
A global model of the response of tropical and sub-tropical forest biodiversity to anthropogenic pressures 2014 Proceedings of the Royal Society B 10.1098/rspb.2014.1371
Functional traits, land-use change and the structure of present and future bird communities in tropical forests 2014 Global Ecology and Biogeography 10.1111/geb.12186
Global soil carbon: understanding and managing the largest terrestrial carbon pool 2014 Carbon Management 10.4155/cmt.13.77
Biophysical suitability, economic pressure and land-cover change: a global probabilistic approach and insights for REDD+ 2014 Sustainability Science 10.1007/s11625-013-0209-5
Towards a diverse conservation ethic 2014 Nature 10.1038/515027a
A mid-term analysis of progress towards international biodiversity targets 2014 Science 10.1126/science.1257484
MODISTools - downloading and processing MODIS remotely-sensed data in R 2014 Ecology and Evolution 10.1002/ece3.1273
Monitoring Protected Area coverage and impact on Key Biodiversity Areas, Important Bird Areas, and Alliance for Zero Extinction sites 2016 Protected Areas: Are They Safeguarding Biodiversity?
Spectacular helmeted hornbill could be wiped out by Chinese demand for 'avian ivory' 2015 The Conservation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment