weighted_centroid: Calculate the weighted centroid

Description Usage Arguments Value Examples

View source: R/weighted_centroid.R

Description

Calculate the coordinate of the weighted centroid from a Spatial Points Data Frame object

Usage

1

Arguments

spdt

Spatial Points data frame with weighted information in the slot data

Value

coordinates x,y of a point

Examples

1
2
3
4
5
6
library(sf)

# SpatialPoints
stations <- as(imhen::stations, "Spatial")
stations@data <- stations@data[, "latitude", drop = FALSE]
weighted_centroid(stations)

choisy/sptools documentation built on Aug. 22, 2019, 12:57 p.m.