Skip to content

Commit 1a1816f

Browse files
authored
Merge pull request #2 from ogi-ogham/names_occuring_atleast_3times
Names occuring atleast 3times
2 parents f0ffb28 + 208350c commit 1a1816f

File tree

6 files changed

+258
-212
lines changed

6 files changed

+258
-212
lines changed

CITATION.cff

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ authors:
55
given-names: Sophie Charlotte
66
orcid: https://orcid.org/0000-0003-4696-2101
77
title: "oghamaps"
8-
version: 0.1
8+
version: 0.2
99
doi: 10.5281/zenodo.3969519
10-
date-released: 2020-08-01
10+
date-released: 2021-01-15
11+

analysis/data/raw_data/townland_abgetipptMacalister1945.csv

Lines changed: 197 additions & 197 deletions
Large diffs are not rendered by default.

analysis/figures/densitymap.jpg

14.6 KB
Loading
82.3 KB
Loading
82.2 KB
Loading

analysis/paper/paper.Rmd

Lines changed: 58 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ ogg_renamed <- ogg
9595
9696
library(tidyr)
9797
# separating the IDs into two columns
98-
ogg_renamed <- separate(data = ogg_renamed, col = PlcIndex, into = c("left", "right"), sep = "-")
98+
ogg_renamed <- separate(data = ogg_renamed, col = "ogham$ciic", into = c("left", "right"), sep = "-")
9999
100100
#naming the columns
101101
colnames(ogg_renamed) <- c("PlcIndex", "weg", "Easting", "Northing")
@@ -130,26 +130,49 @@ library(ggplot2)
130130
library(ggspatial)
131131
132132
ggplot()+
133-
stat_density_2d(data = ogha, aes(x = lon, y = lat, fill = ..level..), alpha = 0.5, h = ogha$count, geom = "polygon")+
133+
stat_density_2d(data = ogha, aes(x = lon, y = lat, fill = ..level..), alpha = 0.75, h = ogha$count, geom = "polygon")+
134134
scale_fill_distiller(palette="Spectral", direction=-1,
135135
name = "Level of density") +
136-
geom_polygon(data = gb_ie, aes(x = long, y = lat, group = group), fill = "white", alpha = 0.1, colour = "lightgrey", size = 0.5) +
137-
annotation_scale(location = "bl", width_hint = 0.2) +
138-
annotation_north_arrow(location = "bl", which_north = "true",
136+
geom_polygon(data = gb_ie, aes(x = long, y = lat, group = group),
137+
fill = "white",
138+
alpha = 0.1,
139+
colour = "lightgrey", size = 0.5) +
140+
annotation_north_arrow(location = "tl", which_north = "true",
139141
pad_x = unit(0.1, "in"), pad_y = unit(0.2, "in"),
140142
style = north_arrow_fancy_orienteering) +
141-
geom_point(data = ogha, aes(x = lon, y = lat), size = 0.5) +
142-
coord_equal(ylim=c(5500000,6250000), xlim = c(250000, 800000))+
143+
annotation_scale(location = "br", width_hint = 0.2) +
144+
geom_point(data = ogha, aes(x = lon, y = lat), size = 0.5, alpha = 0.5) +
145+
coord_equal(ylim=c(5700000,6120000), xlim = c(350000, 720000))+
143146
theme_classic()+
144147
theme(axis.text.x = element_text(angle = 30, hjust = 1))+
145148
scale_x_continuous(labels = scales::comma)+
146149
scale_y_continuous(labels = scales::comma)
147150
151+
148152
ggsave("../figures/densitymap.jpg", width = 20, height = 18, units = "cm", dpi = 300)
149153
150154
```
151155

152156

157+
## in welchem county wie viele steine
158+
```{r}
159+
townlands <- read.csv2("../data/raw_data/townland_abgetipptMacalister1945.csv", sep = "\t")
160+
161+
library(stringr)
162+
townlands$countstones <- str_count(townlands$ciic, coll(","))+1
163+
164+
library(tidyverse)
165+
townlands %>%
166+
group_by(county)%>%
167+
summarise(freq = sum(countstones))%>%
168+
arrange(desc(freq))
169+
170+
# group by
171+
# sum
172+
173+
174+
```
175+
153176

154177

155178
# wie häufig welches Wort
@@ -233,7 +256,8 @@ Kategorisierung der Daten notwendig, da die sehr hohen Werte (123) die eigentlic
233256
```{r corr}
234257
235258
# how often which word
236-
words_only$sum <- rowSums(words_only)
259+
words_only$sum <- rowSums(words_only, na.rm = TRUE)
260+
237261
238262
###################################### words that occur how often?
239263
@@ -242,6 +266,32 @@ words_only_many <- subset(words_only, words_only$sum > 3) # subset to words that
242266
243267
######################################
244268
269+
# Visualisierung, wie häufig die einzelnen Worte vorkommen
270+
271+
272+
library("viridis")
273+
#col <-c("black", viridis(13))
274+
col <-c(viridis(14))
275+
276+
library(ggplot2)
277+
ggplot()+
278+
geom_col(data = words_only_many,
279+
aes(x = reorder(rownames(words_only_many), sum),
280+
y = sum,
281+
fill = as.factor(sum)))+
282+
scale_fill_manual(guide=FALSE,
283+
values = col[5:14],
284+
breaks = c("4", "6", "7","8", "10","12", "18", "19", "33", "123")) +
285+
coord_flip()+
286+
xlab("Ogham words named more than three times")+
287+
ylab("count")+
288+
theme_bw()
289+
290+
ggsave("../figures/ogham_words_count.png", dpi = 300)
291+
```
292+
293+
294+
```{r}
245295
246296
# delete col with sum info
247297
words_only_many <- words_only_many[,-ncol(words_only_many)]
@@ -304,11 +354,6 @@ ggsave("../figures/co-occurence.jpg", width = 20, height = 18, units = "cm", dpi
304354
305355
```
306356

307-
308-
309-
310-
311-
312357
<!-- The following line inserts a page break when the output is MS Word. For page breaks in PDF, use \newpage on its own line. -->
313358
##### pagebreak
314359

0 commit comments

Comments
 (0)