Skip to content

Instantly share code, notes, and snippets.

@InsiderPhD
Created April 9, 2018 09:35
Show Gist options
  • Save InsiderPhD/17003c2ba07f23ae3ab81ec4e65e6b49 to your computer and use it in GitHub Desktop.
Save InsiderPhD/17003c2ba07f23ae3ab81ec4e65e6b49 to your computer and use it in GitHub Desktop.
ggpage Visualisation for Toponyms at Knossos
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