SELGEOmap | R Documentation |
Using area, number of points and Lat-Lon Limits, extracts map strokes and creates a new GEOmap
SELGEOmap(MAP, ncut = 3, acut = c(0, 1e+05), proj = NULL, LIM = NULL)
MAP |
Map structure |
ncut |
minimum number of points in polygon |
acut |
vector, min and max of areas to include |
proj |
map projection |
LIM |
vector, c(lon1, lat1, lon2, lat2) |
Uses sf::st_area function. If proj and LIM are NULL then no selection on limits are used ncut is used to eliminate area calculations with strokes less than the specified number.
GEOmap LIST
STROKES |
list |
nam |
name of stroke |
num |
number of points in stroke |
index |
index of stroke |
col |
color of stroke |
style |
style of stroke |
code |
code of stroke |
LAT1 |
lower left Lat of stroke |
LAT2 |
upper right Lat of stroke |
LON1 |
lower left Lon of stroke |
LON2 |
upper right Lon of stroke |
POINTS |
list |
lat |
vector of lats |
lon |
vector of lons |
Jonathan M. Lees<jonathan.lees@unc.edu>
geoarea, sf::st_area
library(geomapdata)
data(worldmap)
skam = SELGEOmap(worldmap, ncut=3, acut=c(10000, Inf), proj=NULL, LIM=NULL)
par(mfrow=c(2,1))
####### plot world map, with all lines:
plotGEOmap(worldmap)
length(worldmap$STROKES$num)
###### same plot with some lines removed:
plotGEOmap(skam)
length(skam$STROKES$num)
#####################
#####################
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.