Return the k nearest geographical neighbours of a language.

nearest_geo_neighbours(id, k, data = WALS)

Arguments

id

Language's WALS ID

k

How many neighbours to return

data

Dataset to consider; by default the entire WALS

Details

Computed using great_circle_distance. By default (data = WALS), all languages in the WALS atlas will be considered in the computation of the nearest neighbours. By supplying a non-default data argument, it is possible to override this behaviour, e.g. to supply only a subset of the languages.

If the language does not have as many as k neighbours (e.g. because of a strict filtering by data), the neighbours that are found are returned with a warning.

Examples

# 10 nearest neighbours of Egyptian Arabic: nearest_geo_neighbours("aeg", k=10)
#> language_ID language distance #> 2052 arv Arabic (Negev) 364.4500 #> 611 heb Hebrew (Modern) 402.4684 #> 2036 iss Israeli Sign Language 427.6769 #> 881 naj Neo-Aramaic (Arbel Jewish) 428.4382 #> 1015 dom Domari 441.3195 #> 164 hba Hebrew (Modern Ashkenazic) 442.6646 #> 676 cop Coptic 455.4787 #> 2098 apa Arabic (Palestinian) 462.0513 #> 2320 bsi Berber (Siwa) 539.8004 #> 2191 gcy Greek (Cypriot) 560.5366
# 10 nearest neighbours of Egyptian Arabic among those languages for # which feature 13A is attested: nearest_geo_neighbours("aeg", k=10, data=filter_WALS(feature_ID=="13A"))
#> language_ID language distance #> 222 hba Hebrew (Modern Ashkenazic) 442.6646 #> 391 nob Nobiin 1000.7543 #> 164 tur Turkish 1065.4507 #> 227 grk Greek (Modern) 1295.3312 #> 233 krd Kurdish (Central) 1382.0019 #> 421 bej Beja 1427.1992 #> 277 bul Bulgarian 1489.3974 #> 111 alb Albanian 1574.4581 #> 109 tgr Tigré 1684.0881 #> 37 arm Armenian (Eastern) 1688.0955
# 10 nearest neighbours of Egyptian Arabic among those languages for # which feature 13A is attested, among the Afro-Asiatic family: nearest_geo_neighbours("aeg", k=10, data=filter_WALS(feature_ID=="13A" & family=="Afro-Asiatic"))
#> language_ID language distance #> 9 hba Hebrew (Modern Ashkenazic) 442.6646 #> 22 bej Beja 1427.1992 #> 6 tgr Tigré 1684.0881 #> 4 nap Neo-Aramaic (Persian Azerbaijan) 1718.7194 #> 19 awn Awngi 2210.4808 #> 8 amh Amharic 2339.4444 #> 18 dnw Dangaléat (Western) 2374.4694 #> 15 kef Kefa 2588.4151 #> 28 orh Oromo (Harar) 2600.1902 #> 5 tug Tuareg (Ahaggar) 2600.3259