jitter_latlong: Jitter latitude and longitude coordinates

Description Usage Arguments Value See Also Examples

Description

Given a latitude or longitude coordinate, return that coordinate jittered plus or minus a certain maximum amount. This function assumes a spherical earth when calculating the maximum amount to jitter.

Usage

1
jitter_latlong(coord, type = c("lat", "long"), latitude, km = 1)

Arguments

coord

The coordinate in degrees

type

Whether the coordinate is latitude or longitude

latitude

If the coordinate is longitude, then the latitude to use for calculating the maximum amount to jitter.

km

The maximum number of kilometers to jitter a point plus or minus.

Value

The jittered coordinate in degrees.

See Also

length_of_degree

Examples

1
2
jitter_latlong(-73, type = "long", lat = 43, km = 1)
jitter_latlong(42, type = "lat", km = 1)

lmullen/mullenMisc documentation built on May 21, 2019, 7:35 a.m.