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:
r nrow(dfa)
documentsr length(unique(dfa$title))
unique titles (table)r length(unique(dfa$publication_place))
unique publication placesr length(unique(dfa$country))
unique publication countriesr paste(range(dfa$publication_year), sep = "-")
time span 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)
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) }
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")
p <- top_plot(dfa, "publication_place") + scale_y_log10() + ggtitle("Top publication places") print(p)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.