PlotScopusData.R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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