Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
sample code
install.packages('rcrossref')
install.packages('dplyr')
library(rcrossref)
library(dplyr)
# "total-results": 2309
# Crossref http://api.crossref.org/works?filter=update-type:retraction
# fyi the Retraction Watch database has many more 18969 "Retraction or Other Notices"
zz <- cr_works(filter=c(update_type="retraction"),limit=960, offset = 0)
zz$meta
zx <- cr_works(filter=c(update_type="retraction"),limit=960, offset = 960)
zx$meta
zy <- cr_works(filter=c(update_type="retraction"),limit=960, offset = 1920)
zy$meta
zy$data$DOI
zz[1,]
ztotal <- bind_rows(zz,zx,zy)
ztotal[2312,]
newdf <- ztotal[-c(1, 962, 1923), ]
summary(ztotal)
attach(ztotal)
colnames(ztotal)
df <- subset(newdf, select = -c(1,2,3,4,29,31,32,33))
colnames(df)
summary(df)
getwd()
setwd('/home/ross/workspace/crossretractions')
#write.csv(df,file="2309retractions.csv",row.names = F)
colnames(df)
as.data.frame(sort(table(df$publisher)))
as.data.frame(table(df$subtitle))
as.data.frame(table(df$archive))
as.data.frame(table(df$archive_))
as.data.frame(table(df$NA.))
membID <- as.data.frame(sort(table(df$member)))
names(membID)[1]<-"CR.Member.ID"
names(membID)[2]<-"Count.of.CR.registered.retractions"
#membID
#aa <- cr_members(member_ids = 297)
#aa$data$primary_name
abc <- cr_members(membID[,1])$data$primary_name
publisher.retraction.table <- cbind(abc,membID)
publisher.retraction.table
dim(publisher.retraction.table)
#58 Crossref publisher members have one or more Crossref-registered retractions, a 3 column table
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.