Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
PlotScopusData.R
require(ggplot2)
#Save downloaded Scopus data in your working directory
scopusdata<-read.csv("scopusPS2010_2015.csv")
plot1<-ggplot(scopusdata, aes(x=Cited.by)) +
geom_histogram(colour="#535353", fill="#84D5F0", binwidth=2) +
xlab("Number of Citations") + ylab("Number of Articles") +
ggtitle("Citation Data for Psychological Science 2011-2015") +
coord_cartesian(xlim = c(-5, 250))
plot1
#Plot by year
plot1 + facet_grid(Year ~ .)
#Calculate median citation rate per year
aggregate((scopusdata$Cited.by), by=list(Category=scopusdata$Year), FUN=median, na.rm=TRUE)
#Calculate mean citation rate per year
aggregate((scopusdata$Cited.by), by=list(Category=scopusdata$Year), FUN=mean, na.rm=TRUE)
#Sum never cited journal articles per year (Scopus codes 0 citations as NA)
aggregate((is.na(scopusdata$Cited.by)), by=list(Category=scopusdata$Year), FUN=sum)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment