an_thin | R Documentation |
The provided data.frame of names will be thinned down to a smaller number of names. The thinning process attempts to select a subset of names that are uniformly spatially distributed, while simultaneously choosing the most important names (according to their relative score in the score_col
column.
an_thin(gaz, n, score_col = "score", score_weighting = 5, row_limit = 2000)
gaz |
data.frame or SpatialPointsDataFrame: typically as returned by |
n |
numeric: number of names to return |
score_col |
string: the name of the column that gives the relative score of each name (e.g. as returned by |
score_weighting |
numeric: weighting of scores relative to spatial distribution. A lower |
row_limit |
integer: the maximum number of rows allowed in |
Note that the algorithm calculates all pairwise distances between the rows of gaz
. This is memory-intensive, and so if gaz
has many rows the algorithm will fail or on some platforms might crash. Input gaz
data.frames with more than row_limit
rows will not be processed for this reason. You can try increasing row_limit
from its default value if necessary.
data.frame
an_read
, an_suggest
## Not run: g <- an_read(cache = "session") ## get a single name per feature, preferring the ## Japanese name where there is one g <- an_preferred(g, origin = "Japan") ## suggested names for a 100x100 mm map covering 60-90E, 70-60S ## (this is about a 1:12M scale map) suggested <- an_suggest(g, map_extent = c(60, 90, -70, -60), map_dimensions = c(100, 100)) ## find the top 20 names by score head(suggested, 20) ## find the top 20 names chosen for spatial coverage and score an_thin(suggested, 20) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.