rmGeoIdentity: Remove geographical identity

View source: R/rmGeoIdentity.R

rmGeoIdentityR Documentation

Remove geographical identity

Description

Build a buffer around the a set of geographical coordinates and take a random point around the buffer. The function is used to omit the precise location of tricot participants but keeping a close distance to the trial environment.

Usage

rmGeoIdentity(longlat, dist = 0.015, nQuadSegs = 2L, seed = NULL, ...)

Arguments

longlat

a data.frame or matrix with geographical coordinates long lat

dist

numeric, buffer distance for all lonlat

nQuadSegs

integer, number of segments per quadrant

seed

integer, the seed for random number generation. If NULL (the default), ClimMobTools will set the seed randomly

...

further arguments passed to sf methods

Value

A data frame with the random coordinates long lat within the buffer

Examples


library("sf")

xy = matrix(c(11.097799, 60.801090,
               11.161298, 60.804199,
               11.254428, 60.822457),
             nrow = 3, ncol = 2, byrow = TRUE)

rmGeoIdentity(xy, seed = 1501)

#' the function also handles NAs

xy2 = matrix(c(11.097799, 60.801090,
                NA, NA,
                11.161298, 60.804199,
                11.254428, 60.822457,
                11.254428, NA),
              nrow = 5, ncol = 2, byrow = TRUE)

rmGeoIdentity(xy2)


ClimMobTools documentation built on Nov. 27, 2025, 5:06 p.m.