# isogloss example
# choose one feature from hessen dataset (number 4)
data(hessen)
f4 <- hessen$data[,9:13]
# look for area for interpolation, changing density and grid parameters
# suitable parameters can be passed through to function levelMap below
boundary(hessen$villages, density = 0.1, grid = 10)
# useful size of pies has to be determined by changing cex
plot(hessen$boundary, main = NULL)
levelMap(hessen$villages, f4, draw = 3, cex = 0.8, normalize.frequency = TRUE
, density = 0.1, grid = 10, add = TRUE, cex.legend = 0.5, scale.pies = TRUE)
if (FALSE) {
# another isogloss example:
# "f" sounds in German dialects in the words "Kochlöffel"
# might give Unicode-errors because of phonetic symbols
require(mapdata)
map("worldHires", "Germany", fill = TRUE, col = "grey90")
data(dialects)
levelMap(dialects$villages, dialects$data[,21], levels = c(0.20, 0.22, 0.24)
, add = TRUE, position = "topleft")
title(main = "f-sound in \'Kochlöffel\'")
}
# semantic map example
# location of points via multidimensional scaling of complete data
data(haspelmath)
d <- dist(haspelmath)
p <- MASS::isoMDS(d)$points
# testing boundary parameters
boundary(p)
boundary(p, density = 0.004, box = 0.15, tightness = 8)
# labels to be plotted instead of points
text <- gsub("\\.", "\n", rownames(haspelmath))
# show a few languages for Haspelmaths indefinite data
# using a quick dummy function to set all parameters
indef <- function(columns) {
levelMap(p, haspelmath[,columns]
, levels = 0.1, labels = text
, density = 0.004, box = 0.15, tightness = 8
, lambda = 0.1, note = FALSE)
}
oldpar <- par("mfcol")
par(mfcol = c(2,3))
indef(1:3)
indef(4:6)
indef(7:9)
indef(10:12)
indef(13:17)
indef(18:22)
par(mfcol = oldpar)
Run the code above in your browser using DataLab