-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
5,622 additions
and
2,621 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,348 @@ | ||
rm(list=ls()) | ||
library(lingtypology) | ||
lat.lang("Georgian") | ||
long.lang("Georgian") | ||
gltc.lang("Georgian") | ||
meta <- read_tsv("meta.csv") | ||
non_ec <- meta[(meta$aff != "East Caucasian"),] | ||
non_ec <- meta[(meta$family != "East Caucasian"),] | ||
map.feature(gltc.lang(non_ec$glottocode), | ||
features = non_ec$lang, | ||
color = non_ec$lang_color, | ||
latitude = non_ec$gen_lat, | ||
longitude = non_ec$gen_lat) | ||
map.feature(gltc.lang(non_ec$glottocode), | ||
features = non_ec$lang, | ||
color = non_ec$lang_color, | ||
latitude = non_ec$gen_lat, | ||
longitude = non_ec$gen_long) | ||
map.feature(lang.gltc(non_ec$glottocode), | ||
features = non_ec$lang, | ||
color = non_ec$lang_color, | ||
latitude = non_ec$gen_lat, | ||
longitude = non_ec$gen_long) | ||
map.feature(lang.gltc(non_ec$glottocode), | ||
features = non_ec$lang, | ||
color = non_ec$lang_color, | ||
latitude = non_ec$gen_lat, | ||
longitude = non_ec$gen_lon) | ||
meta <- read_tsv("meta.csv") | ||
non_ec <- meta[(meta$family != "East Caucasian"),] | ||
map.feature(lang.gltc(non_ec$glottocode), | ||
features = non_ec$lang, | ||
color = non_ec$lang_color, | ||
latitude = non_ec$gen_lat, | ||
longitude = non_ec$gen_lon) | ||
map.feature(lang.gltc(non_ec$glottocode), | ||
features = non_ec$aff, | ||
color = non_ec$aff_color, | ||
latitude = non_ec$gen_lat, | ||
longitude = non_ec$gen_lon) | ||
villages <- read_tsv("villages.csv") | ||
kutans <- read_tsv("samira_kutans.csv") | ||
kutans <- read_csv("samira_kutans.csv") | ||
kutans <- read_csv("samira_kutans.csv") | ||
View(kutans) | ||
villages_kutans <- merge(villages, kutans, by = "village") | ||
villages_kutans <- left_join(villages, kutans, by = "village") | ||
View(villages_kutans) | ||
duplicated(villages_kutans$village) | ||
dup <- duplicated(villages_kutans$village) | ||
table(dup) | ||
villages_kutans$duplicates <- duplicated(villages_kutans$village) | ||
kutans_small <- kutans %>% | ||
select(village, kutans) | ||
villages_kutans <- left_join(villages, kutans_small, by = "village") | ||
View(villages_kutans) | ||
villages_kutans <- merge(villages, kutans_small, by = "village") | ||
View(kutans_small) | ||
setdiff(villages$village, kutans_small$village) | ||
setdiff(kutans_small$village, villages$village) | ||
villages_kutans <- left_join(villages, kutans_small, by = "village") | ||
villages_kutans$duplicates <- duplicated(villages_kutans$village) | ||
villages <- read_tsv("villages.csv") | ||
kutans <- read_csv("samira_kutans.csv") | ||
kutans_small <- kutans %>% | ||
select(village, kutans) | ||
villages_kutans <- left_join(villages, kutans_small, by = "village") | ||
villages_kutans$duplicates <- duplicated(villages_kutans$village) | ||
table(villages_kutans$duplicates) | ||
View(villages) | ||
View(villages_kutans) | ||
View(kutans) | ||
sort(unique(villages_kutans$village)) | ||
sort(unique(villages_kutans$village)) == sort(unique(villages$village)) | ||
sum(sort(unique(villages_kutans$village)) == sort(unique(villages$village))) | ||
sum(sort(unique(villages_kutans$village)) != sort(unique(villages$village))) | ||
villages_kutans %>% | ||
full_join(villages) | ||
villages <- read_tsv("villages.csv") | ||
kutans <- read_csv("samira_kutans.csv") | ||
villages_kutans %>% | ||
full_join(villages) | ||
villages_kutans %>% | ||
full_join(villages) %>% | ||
table(villages_kutans$duplicates) | ||
villages_kutans$duplicates <- duplicated(villages_kutans$village) | ||
villages_kutans %>% | ||
full_join(villages) %>% | ||
table(villages_kutans$duplicates) | ||
villages_kutans <- left_join(villages, kutans_small, by = "village") | ||
villages_kutans$duplicates <- duplicated(villages_kutans$village) | ||
villages_kutans %>% | ||
full_join(villages) %>% | ||
table(villages_kutans$duplicates) | ||
villages <- read_tsv("villages.csv") | ||
kutans <- read_csv("samira_kutans.csv") | ||
kutans_small <- kutans %>% | ||
select(village, kutans) | ||
villages_kutans <- left_join(villages, kutans_small, by = "village") | ||
villages_kutans$duplicates <- duplicated(villages_kutans$village) | ||
villages_kutans <- full_join(villages) | ||
villages_kutans %>% | ||
full_join(villages) %>% | ||
table(villages_kutans$duplicates) | ||
villages <- read_tsv("villages.csv") | ||
kutans <- read_csv("samira_kutans.csv") | ||
kutans_small <- kutans %>% | ||
select(village, kutans) | ||
villages_kutans <- left_join(villages, kutans_small, by = "village") | ||
villages_kutans$duplicates <- duplicated(villages_kutans$village) | ||
villages_kutans %>% | ||
full_join(villages) %>% | ||
table(villages_kutans$duplicates) | ||
villages_kutans$duplicates | ||
villages_kutans %>% | ||
count(duplicated) | ||
villages_kutans %>% | ||
count(duplicates) | ||
villages_kutans %>% | ||
count(duplicates) %>% | ||
View() | ||
villages_kutans %>% | ||
View() | ||
villages <- read_tsv("villages.csv") | ||
villages %>% | ||
distinct() | ||
kutans <- read_csv("samira_kutans.csv") | ||
kutans | ||
kutans %>% | ||
distinct() | ||
kutans %>% | ||
select(village, kutans) | ||
kutans %>% | ||
select(village, region, kutans) %>% | ||
full_join(villages) | ||
View(kutans) | ||
kutans %>% | ||
select(village, lat, long, kutans) %>% | ||
full_join(villages, by = c("village", "lat", "long")) | ||
kutans %>% | ||
select(village, lat, lon, kutans) %>% | ||
full_join(villages, by = c("village", "lat", "lon")) | ||
knitr::opts_chunk$set(echo = TRUE) | ||
# re-order the elements in the legend (by default they are in alphabetical order) | ||
vill_meta$lang <- factor(vill_meta$lang, levels =c( | ||
"Dargwa", "Lak", "Bats", "Ingush", "Chechen", "Khinalug", "Archi", "Tsakhur", "Rutul", "Kryz", "Budukh", "Udi", "Lezgian", "Agul", "Tabasaran", "Avar", "Andi", "Botlikh", "Godoberi", "Chamalal", "Bagvalal", "Tindi", "Karata", "Akhvakh", "Tsez", "Hinuq", "Bezhta", "Hunzib", "Khwarshi", "Nogai", "Kumyk", "Azerbaijani", "Armenian")) | ||
# re-order the elements in the legend (by default they are in alphabetical order) | ||
vill_meta$lang <- factor(vill_meta$lang, levels =c( | ||
"Dargwa", "Lak", "Bats", "Ingush", "Chechen", "Khinalug", "Archi", "Tsakhur", "Rutul", "Kryz", "Budukh", "Udi", "Lezgian", "Agul", "Tabasaran", "Avar", "Andi", "Botlikh", "Godoberi", "Chamalal", "Bagvalal", "Tindi", "Karata", "Akhvakh", "Tsez", "Hinuq", "Bezhta", "Hunzib", "Khwarshi", "Nogai", "Kumyk", "Azerbaijani", "Armenian", "Tat", "Georgian")) | ||
# packages | ||
library(tidyverse) # data manipulation | ||
library(lingtypology) # drawing maps | ||
# load data | ||
vill <- read_tsv("data/villages.csv") # dataframe with all villages, coordinates and languages | ||
meta <- read_tsv("data/meta.csv") # dataframe with language metadata and color schemes | ||
# data preparation | ||
vill <- vill[complete.cases(vill$lat),] # remove villages without coordinates | ||
meta_core <- meta %>% # remove idioms not (yet) recognized as distinct | ||
filter(core == "yes") | ||
vill_meta <- merge(vill, meta_core, by = "lang") # merge villages with metadata | ||
# re-order the elements in the legend (by default they are in alphabetical order) | ||
vill_meta$lang <- factor(vill_meta$lang, levels =c( | ||
"Dargwa", "Lak", "Bats", "Ingush", "Chechen", "Khinalug", "Archi", "Tsakhur", "Rutul", "Kryz", "Budukh", "Udi", "Lezgian", "Agul", "Tabasaran", "Avar", "Andi", "Botlikh", "Godoberi", "Chamalal", "Bagvalal", "Tindi", "Karata", "Akhvakh", "Tsez", "Hinuq", "Bezhta", "Hunzib", "Khwarshi", "Nogai", "Kumyk", "Azerbaijani", "Armenian", "Tat", "Georgian")) | ||
# draw map | ||
map.feature(lang.gltc(vill_meta$glottocode), | ||
latitude = vill_meta$lat, | ||
longitude = vill_meta$lon, | ||
features = vill_meta$lang, | ||
color = vill_meta$lang_color, | ||
label = vill_meta$lang, | ||
zoom.control = T, | ||
popup = vill_meta$village, | ||
tile = c("Esri.WorldTopoMap")) | ||
meta_core$emphasis <- "emphasis" | ||
map.feature(lang.gltc(vill_meta$glottocode), | ||
latitude = vill_meta$lat, | ||
longitude = vill_meta$lon, | ||
features = vill_meta$lang, | ||
color = vill_meta$lang_color_pale, | ||
label = vill_meta$lang, | ||
zoom.control = T, | ||
popup = vill_meta$village, | ||
tile = c("Esri.WorldTopoMap")) %>% | ||
map.feature(lang.gltc(meta_core$glottocode), | ||
latitude = meta_core$gltc_lat, | ||
longitude = meta_core$gltc_lon, | ||
features = meta_core$lang, | ||
stroke.features = meta_core$emphasis, | ||
stroke.color = "black", | ||
stroke.legend = F, | ||
width = 3, stroke.radius = 5, | ||
label = meta_core$lang, | ||
color = meta_core$lang_color, | ||
zoom.control = T, | ||
pipe.data = .) | ||
meta_core$emphasis <- "emphasis" | ||
map.feature(lang.gltc(vill_meta$glottocode), | ||
latitude = vill_meta$lat, | ||
longitude = vill_meta$lon, | ||
features = vill_meta$lang, | ||
color = vill_meta$lang_color_pale, | ||
label = vill_meta$lang, | ||
zoom.control = T, | ||
tile = c("Esri.WorldTopoMap")) %>% | ||
map.feature(lang.gltc(meta_core$glottocode), | ||
latitude = meta_core$gltc_lat, | ||
longitude = meta_core$gltc_lon, | ||
features = meta_core$lang, | ||
stroke.features = meta_core$emphasis, | ||
stroke.color = "black", | ||
stroke.legend = F, | ||
width = 3, stroke.radius = 5, | ||
label = meta_core$lang, | ||
color = meta_core$lang_color, | ||
zoom.control = T, | ||
pipe.data = .) | ||
vill_meta$aff <- factor(vill_meta$aff, levels =c("Dargwa", "Lak", "Nakh", "Khinalug", "Lezgic", "Avar", "Andic", "Tsezic", "Kipchak", "Oghuz", "Armenic", "Iranian", "Georgic")) | ||
map.feature(lang.gltc(vill_meta$glottocode), | ||
latitude = vill_meta$lat, | ||
longitude = vill_meta$lon, | ||
features = vill_meta$aff, | ||
width = 8, | ||
label = vill_meta$lang, | ||
color = vill_meta$aff_color, | ||
zoom.control = T, | ||
popup = vill_meta$village, | ||
tile = c("Esri.WorldTopoMap")) | ||
# packages | ||
library(tidyverse) # data manipulation | ||
library(lingtypology) # drawing maps | ||
# load data | ||
vill <- read_tsv("data/villages.csv") # dataframe with all villages, coordinates and languages | ||
meta <- read_tsv("data/meta.csv") # dataframe with language metadata and color schemes | ||
# data preparation | ||
vill <- vill[complete.cases(vill$lat),] # remove villages without coordinates | ||
meta_core <- meta %>% # remove idioms not (yet) recognized as distinct | ||
filter(core == "yes") | ||
vill_meta <- merge(vill, meta_core, by = "lang") # merge villages with metadata | ||
# re-order the elements in the legend (by default they are in alphabetical order) | ||
vill_meta$lang <- factor(vill_meta$lang, levels =c( | ||
"Dargwa", "Lak", "Bats", "Ingush", "Chechen", "Khinalug", "Archi", "Tsakhur", "Rutul", "Kryz", "Budukh", "Udi", "Lezgian", "Agul", "Tabasaran", "Avar", "Andi", "Botlikh", "Godoberi", "Chamalal", "Bagvalal", "Tindi", "Karata", "Akhvakh", "Tsez", "Hinuq", "Bezhta", "Hunzib", "Khwarshi", "Nogai", "Kumyk", "Azerbaijani", "Armenian", "Tat", "Georgian")) | ||
# draw map | ||
map.feature(lang.gltc(vill_meta$glottocode), | ||
latitude = vill_meta$lat, | ||
longitude = vill_meta$lon, | ||
features = vill_meta$lang, | ||
color = vill_meta$lang_color, | ||
label = vill_meta$lang, | ||
zoom.control = T, | ||
popup = vill_meta$village, | ||
tile = c("Esri.WorldTopoMap")) | ||
rm(list=ls()) | ||
knitr::opts_chunk$set(echo = TRUE) | ||
# packages | ||
library(tidyverse) # data manipulation | ||
library(lingtypology) # drawing maps | ||
# load data | ||
vill <- read_tsv("data/villages.csv") # dataframe with all villages, coordinates and languages | ||
meta <- read_tsv("data/meta.csv") # dataframe with language metadata and color schemes | ||
# data preparation | ||
vill <- vill[complete.cases(vill$lat),] # remove villages without coordinates | ||
meta_core <- meta %>% # remove idioms not (yet) recognized as distinct | ||
filter(core == "yes") | ||
vill_meta <- merge(vill, meta_core, by = "lang") # merge villages with metadata | ||
# re-order the elements in the legend (by default they are in alphabetical order) | ||
vill_meta$lang <- factor(vill_meta$lang, levels =c( | ||
"Dargwa", "Lak", "Bats", "Ingush", "Chechen", "Khinalug", "Archi", "Tsakhur", "Rutul", "Kryz", "Budukh", "Udi", "Lezgian", "Agul", "Tabasaran", "Avar", "Andi", "Botlikh", "Godoberi", "Chamalal", "Bagvalal", "Tindi", "Karata", "Akhvakh", "Tsez", "Hinuq", "Bezhta", "Hunzib", "Khwarshi", "Nogai", "Kumyk", "Azerbaijani", "Armenian", "Tat", "Georgian")) | ||
# draw map | ||
map.feature(lang.gltc(vill_meta$glottocode), | ||
latitude = vill_meta$lat, | ||
longitude = vill_meta$lon, | ||
features = vill_meta$lang, | ||
color = vill_meta$lang_color, | ||
label = vill_meta$lang, | ||
zoom.control = T, | ||
popup = vill_meta$village, | ||
tile = c("Esri.WorldTopoMap")) | ||
vill_meta$aff <- factor(vill_meta$aff, levels =c("Dargwa", "Lak", "Nakh", "Khinalug", "Lezgic", "Avar", "Andic", "Tsezic", "Kipchak", "Oghuz", "Armenic", "Iranian", "Georgic")) | ||
map.feature(lang.gltc(vill_meta$glottocode), | ||
latitude = vill_meta$lat, | ||
longitude = vill_meta$lon, | ||
features = vill_meta$aff, | ||
width = 8, | ||
label = vill_meta$lang, | ||
color = vill_meta$aff_color, | ||
zoom.control = T, | ||
popup = vill_meta$village, | ||
tile = c("Esri.WorldTopoMap")) | ||
knitr::opts_chunk$set(echo = TRUE) | ||
# packages | ||
library(tidyverse) # data manipulation | ||
library(lingtypology) # drawing maps | ||
# load data | ||
vill <- read_tsv("data/villages.csv") # dataframe with all villages, coordinates and languages | ||
meta <- read_tsv("data/meta.csv") # dataframe with language metadata and color schemes | ||
# data preparation | ||
vill <- vill[complete.cases(vill$lat),] # remove villages without coordinates | ||
meta_core <- meta %>% # remove idioms not (yet) recognized as distinct | ||
filter(core == "yes") | ||
vill_meta <- merge(vill, meta_core, by = "lang") # merge villages with metadata | ||
vill_meta$aff <- factor(vill_meta$aff, levels =c("Dargwa", "Lak", "Nakh", "Khinalug", "Lezgic", "Avar", "Andic", "Tsezic", "Kipchak", "Oghuz", "Armenic", "Iranian", "Georgic")) | ||
map.feature(lang.gltc(vill_meta$glottocode), | ||
latitude = vill_meta$lat, | ||
longitude = vill_meta$lon, | ||
features = vill_meta$aff, | ||
width = 8, | ||
label = vill_meta$lang, | ||
color = vill_meta$aff_color, | ||
zoom.control = T, | ||
popup = vill_meta$village, | ||
tile = c("Esri.WorldTopoMap")) | ||
vill_meta$aff <- factor(vill_meta$aff, levels =c("Dargwa", "Lak", "Nakh", "Khinalug", "Lezgic", "Avar", "Andic", "Tsezic", "Kipchak", "Oghuz", "Armenic", "Iranian", "Georgic")) | ||
map.feature(lang.gltc(vill_meta$glottocode), | ||
latitude = vill_meta$lat, | ||
longitude = vill_meta$lon, | ||
features = vill_meta$aff, | ||
width = 8, | ||
label = vill_meta$lang, | ||
color = vill_meta$aff_color, | ||
zoom.control = T, | ||
popup = vill_meta$village, | ||
tile = c("Esri.WorldTopoMap")) | ||
# re-order the elements in the legend (by default they are in alphabetical order) | ||
vill_meta$lang <- factor(vill_meta$lang, levels =c( | ||
"Dargwa", "Lak", "Bats", "Ingush", "Chechen", "Khinalug", "Archi", "Tsakhur", "Rutul", "Kryz", "Budukh", "Udi", "Lezgian", "Agul", "Tabasaran", "Avar", "Andi", "Botlikh", "Godoberi", "Chamalal", "Bagvalal", "Tindi", "Karata", "Akhvakh", "Tsez", "Hinuq", "Bezhta", "Hunzib", "Khwarshi", "Nogai", "Kumyk", "Azerbaijani", "Armenian", "Tat", "Georgian")) | ||
# draw map | ||
map.feature(lang.gltc(vill_meta$glottocode), | ||
latitude = vill_meta$lat, | ||
longitude = vill_meta$lon, | ||
features = vill_meta$lang, | ||
color = vill_meta$lang_color, | ||
label = vill_meta$lang, | ||
zoom.control = T, | ||
popup = vill_meta$village, | ||
tile = c("Esri.WorldTopoMap")) | ||
# re-order the elements in the legend (by default they are in alphabetical order) | ||
vill_meta$lang <- factor(vill_meta$lang, levels =c( | ||
"Dargwa", "Lak", "Bats", "Ingush", "Chechen", "Khinalug", "Archi", "Tsakhur", "Rutul", "Kryz", "Budukh", "Udi", "Lezgian", "Agul", "Tabasaran", "Avar", "Andi", "Botlikh", "Godoberi", "Chamalal", "Bagvalal", "Tindi", "Karata", "Akhvakh", "Tsez", "Hinuq", "Bezhta", "Hunzib", "Khwarshi", "Nogai", "Kumyk", "Azerbaijani", "Armenian", "Tat", "Georgian")) | ||
# draw map | ||
map.feature(lang.gltc(vill_meta$glottocode), | ||
latitude = vill_meta$lat, | ||
longitude = vill_meta$lon, | ||
features = vill_meta$lang, | ||
color = vill_meta$lang_color, | ||
label = vill_meta$lang, | ||
zoom.control = T, | ||
popup = vill_meta$village, | ||
tile = c("Esri.WorldTopoMap")) |
Binary file not shown.
Oops, something went wrong.