View source: R/spatial_manipulation.R
order_polygons | R Documentation |
For a spatial polygons data frame or list of spatial polygons data frames, return character vector of all the unique identifiers in either ascending or descending order of area. If the unique identifiers have more than on observation associated with them, their polygons are combined into a single observation before the areas are calculated. If no variable for unique identifiers is provided, then all polygons in each spatial polygons data frame provided are considered to be a single observation; note that this is inappropriate unless providing a list of SPDFs. In the case of a list of SPDFs either the variable containing unique identifiers must be named identically for all (in which case there can be more than one polygon identity recognized in each) or no variable provided (in which case each SPDF will be dissolved to a single observation and assigned an identity based on the list's names or if the list is unnamed using the index of the SPDF in the list).
order_polygons(polygons, id_var = NULL, order = "ascending")
polygons |
Spatial Polygons Data Frame or list of Spatial Polygons Data Frames. If only a single SPDF, it must have at least the variable matching the value of |
id_var |
Optional character string. Must match the name of the variable in every SPDF in |
order |
Charcter string. Either "ascending" or "descending" which determines the order to sort polygons in according to their areas. Defaults to |
Vector of unique identifiers.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.