Created
April 9, 2018 09:35
-
-
Save InsiderPhD/17003c2ba07f23ae3ab81ec4e65e6b49 to your computer and use it in GitHub Desktop.
ggpage Visualisation for Toponyms at Knossos
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
library(tidyverse) | |
library(ggpage) | |
tablets$text <- as.character(tablets$inscription) | |
tablets_long <- subset(tablets, nchar(as.character(tablets$inscription)) >15, type = "chars") | |
knossos <- tablets_long[grep("KN", tablets$location, ignore.case=T),] | |
knossos$text <- gsub("-", "", as.character(knossos$inscription)) | |
knossos <- knossos[complete.cases(knossos),] | |
head(knossos, 100) %>% | |
ggpage_build(wtl = FALSE, y_space_pages = 0, ncol = 7) %>% | |
mutate(highlight = case_when(word %in% c("konoso", "konosode", "konosija", "konosijo") ~ "Knossos", | |
word %in% c("kudonija", "kudonijade", "kudonijo") ~ "Khania", | |
word %in% c("aminiso", "aminisijo", "aminisija", "aminisode") ~ "Aminisos", | |
word %in% c("puro", "purojo") ~ "Pylos", | |
TRUE ~ "other")) %>% | |
ggpage_plot(mapping = aes(fill = highlight)) + | |
labs(title = "Toponyms in the Knossos Tablets", | |
fill = NULL) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Dataset: https://github.com/InsiderPhD/Linear-B-Dataset/blob/master/tablet-sets/tablets.csv