User Tools

Site Tools


en:data:gentry_rscript

Draw the maps with distribution of localities - on the whole World, and in East Asia:

# load data frame with plot coordinates
gentry.coord <- read.delim ('https://raw.githubusercontent.com/zdealveindy/anadat-r/master/data/gentry.coord.txt', row.names = 1)
gentry.coord.ea <- read.delim ('https://raw.githubusercontent.com/zdealveindy/anadat-r/master/data/gentry.coord.ea.txt', row.names = 1)
 
 
library (maps)
library (mapdata)
png ("gentry-east-asia.png", width = 9, height = 4.5, units = 'in', res = 300)
par (mar = c(0,0,0,0))
map ('worldHires', xlim = c(50,190), ylim = c(-10,50), fill = T, col = 'grey90')
abline (h = 0, col = 'grey')
points (Lat ~ Long, gentry.coord.ea, pch = 24, bg = 'red', col = 'white', cex = 1.5, lwd = 2)
text (Lat ~ Long, gentry.coord.ea['chiba',, drop = F], col = 'red', adj = -.1, label = 'Chiba (Japan)')
text (Lat ~ Long, gentry.coord.ea['kenting',, drop = F], col = 'red', adj = -.1, label = 'Nanjenshan & Kenting (Taiwan)')
text (Lat ~ Long, gentry.coord.ea['palanan',, drop = F], col = 'red', adj = -.1, label = 'Palanan (Philippines)')
text (Lat ~ Long, gentry.coord.ea['semengoh',, drop = F], col = 'red', adj = -.1, label = 'Semengoh (Malaysia)')
box ()
dev.off ()
 
png ('gentry-world.png', width = 9, height = 4.5, units = 'in', res = 300)
par (mar = c(0,0,0,0))
map ('worldHires', fill = T, col = 'grey90')
abline (h = 0, col = 'grey')
points (Lat ~ Long, gentry.coord, pch = 24, bg = 'red', col = 'white', cex = 1, lwd = 1)
box ()
dev.off ()
en/data/gentry_rscript.txt · Last modified: 2018/06/06 08:07 by David Zelený