Pointcluster | R Documentation |
Cluster points within a given distance of one another
Pointcluster(
Points,
Distance,
In_water_distance = FALSE,
Latitude_column,
Longitude_column,
PointID_column,
Points_crs = 4326,
Calculation_crs = 32610,
Water_map = NULL,
Water_map_transitioned = NULL,
Grid_size = 75,
Expand = TRUE
)
Points |
A dataframe of points with latitude and longitude |
Distance |
Clustering distance in meters. |
In_water_distance |
Should clustering be based on in-water distance? If yes, in-water distances will be calculated with |
Latitude_column |
The unquoted name of the column in the |
Longitude_column |
The unquoted name of the column in the |
PointID_column |
The unquoted name of the column in the |
Points_crs |
Coordinate reference system for your |
Calculation_crs |
Coordinate reference system used for the calculation. If a latitude/longitude system are used, errors may be returned since some calculations assume a planar surface. Defaults to |
Water_map |
Object of class sf representing a map of all waterways in your region of interest |
Water_map_transitioned |
A rasterized, transitioned, and geo-corrected version of the water map. This is optional to save time if you will be running this function frequently with the same base map. |
Grid_size |
Grid size (in meters) used to rasterize the map. Defaults to 75. |
Expand |
Should data be expanded at the end? If |
The parameters Water_map
, Water_map_transitioned
and Grid_size
will be ignored unless In_water_distance = TRUE
.
A tibble relating each point to its assigned cluster. The returned Latitude and Longitude values represent the mean values across all points in each cluster.
library(tibble)
Points <- tibble(Latitude = c(38.07194, 38.09306, 38.11722,
38.11528, 38.07020, 38.09383,
38.11783, 38.06481, 38.11400,
38.06750, 38.11556),
Longitude = c(-122.0961, -122.0692, -122.0472,
-122.0519, -122.0941, -122.0697,
-122.0418, -122.0978, -122.0462,
-122.0956, -122.0424),
ID = c("EMP NZ022", "EMP NZ024", "EMP NZ028",
"EMP NZ030", "FMWT 416", "FMWT 418",
"FMWT 602", "TNS 418", "TNS 602",
"twentymm 418", "twentymm 602"))
Points_clust<-Pointcluster(Points, 1000, FALSE, Latitude, Longitude, ID, Expand=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.