In [13]:
library(ggplot2)
library(plyr)
library(scales)
library(dplyr)
library(stringr)
library(RColorBrewer)
library(httr)
library(tidyr)
library(psych)
In [ ]:
subject,year,count,percentage,sum copper,2006,32,79,5255 silver,2006,4176,79,5255
In [11]:
load("../data/2018-10-08_all_meta.Rda",verbose=TRUE)
print((meta$registrants$years[1]))
registrants <- meta$registrants
citation_types <- meta$`citation-types`
relation_types <- meta$`relation-types`
pairings <- meta$pairings
In [18]:
hundred_plot<-function(types){
print(summary(types$count))
print(describe(types$count))
fill <- c("#5F9EA0", "#E1B372", "#E1B373", "#E1B374", "#E1B375", "#E1B376", "#E1B377", "#E1B379", "#E1B379", "#E1B379")
p4 <- ggplot() + geom_bar(aes(y = percentage, x = column, fill = type), data = (types),
stat="identity", colour="white") + labs(x="Type", y="Percentage") +
scale_y_continuous(labels = dollar_format(suffix = "%", prefix = "")) +
ggtitle("DOI-DOI Links by Type (%)")
p4 + coord_flip() + theme(
plot.margin = unit(c(5,0,5,2), "cm"))
#https://stackoverflow.com/questions/34399760/change-color-for-specific-variable-r-ggplot-stacked-bar-chart
}
In [19]:
types <- relation_types %>%
mutate(total = sum(count), percentage = (count/total)*100, type=title, column="Type") %>%
arrange(desc(total))
hundred_plot(types)
In [20]:
citation_types_ss <- citation_types %>%
mutate(total = sum(count), percentage = (count/total)*100, type=title, column="Type") %>%
arrange(desc(total))
hundred_plot(citation_types_ss)
In [ ]: