# Generate sample coordinates
set.seed(123)
result <- matrix(runif(20, min = -180, max = 180), ncol = 2) # 10 random points
# Perform thinning with local kd-trees
result_partitioned <- distance_thinning(result , thin_dist = 5000, trials = 5,
search_type = "local_kd_tree", all_trials = TRUE)
print(result_partitioned)
# Perform thinning estimating max number of neighbors
result_estimated <- distance_thinning(result , thin_dist = 5000, trials = 5,
search_type = "k_estimation", all_trials = TRUE)
print(result_estimated)
Run the code above in your browser using DataLab