Summary for r selected.author

library(ggplot2)
library(tidyr)
library(dplyr)
library(reshape2)
library(estc)
library(bibliographica)
library(dplyr)

dfa <- dplyr::filter(df.preprocessed, author %in% selected.author)

# Drop empty levels from factors
inds <- which(sapply(dfa, class) == "factor")
for (i in inds) {dfa[,i] <- droplevels(dfa[,i])}

title.file < gsub(" ", "_", paste("summary_author_title_", selected.author, ".tab", sep = ""))
tmp <- write_xtable(dfa$title, file = title.file)

This author has:

p <- NULL
p <- top_plot(df, "title", 10) + ggtitle(paste("Top titles")) + ylab("Title count")
print(p)

Publication timeline:

theme_set(theme_bw(20))
df <- dfa %>% group_by(publication_year) %>%
         tally() %>% arrange(publication_year)
p <- ggplot(df, aes(x = publication_year, y = n)) +
       geom_bar(stat = "identity", position = "stack", color = "black") +
       xlab("Publication Year") +
       ylab("Title Count") +
       ggtitle("Title count timeline")
print(p)
theme_set(theme_bw(20))
df <- dfa %>% group_by(publication_year, country) %>%
         tally() %>% arrange(publication_year)
p <- ggplot(df, aes(x = publication_year, y = n, group = country)) +
       geom_line(aes(color = country)) +
       xlab("Publication Year") +
       ylab("Title Count") +
       ggtitle("Title count timeline")
print(p)

Selected title

theme_set(theme_bw(20))
for (selected.title in names(rev(sort(table(dfa$title))))[1:4]) {
  df <- dfa %>% filter(title == selected.title) %>%
         group_by(publication_decade, country) %>%
         tally() %>% arrange(publication_decade) 
  p <- ggplot(df, aes(x = publication_decade, y = n)) +
       geom_bar(aes(fill = country), stat = "identity") + 
       xlab("Publication Decade") +
       ylab("Title Count") +
       ggtitle(selected.title)
  print(p)
}

Language

lan <- sort(colSums(select(dfa, starts_with("language"))))
lan <- lan[lan > 0]
names(lan) <- gsub("language\\.", "", names(lan))
par(mar = c(5, 8, 3, 1)); barplot(lan, las = 1, horiz = T, main = "Language", xlab = "Title count")

Publication place

p <- top_plot(dfa, "publication_place") + scale_y_log10() + ggtitle("Top publication places")
print(p)


rOpenGov/bibliographica documentation built on April 10, 2022, 8:51 p.m.