Learn R Programming

tectonicr (version 0.4.9)

PoR_distance: Distance to Pole of Rotation

Description

Retrieve the (angular) great-circle distance between a point and the PoR (Euler pole).

Usage

PoR_distance(x, PoR, FUN = orthodrome)

Value

numeric vector. Great-circle distance in degree

Arguments

x

Can be either a "data.frame" containing lat and lon coordinates of a point in the geographical CRS or the lat.PoR, lon.PoR) of the point in the PoR CRS, a two-column matrix containing the lat and lon coordinates, a sf object, or a raster object.

PoR

Pole of Rotation. "data.frame" containing the geographical coordinates of the Euler pole

FUN

function to calculate the great-circle distance. orthodrome(), haversine() (the default), or vincenty().

Examples

Run this code
data("nuvel1")
por <- subset(nuvel1, nuvel1$plate.rot == "na") # North America relative to Pacific plate
data("san_andreas")

# distance form sf object
PoR_distance(san_andreas, por) |> head()

# distance form data.frame
PoR_distance(sf::st_drop_geometry(san_andreas), por) |> head()
PoR_distance(sf::st_drop_geometry(san_andreas), por, FUN = orthodrome) |> head()
PoR_distance(sf::st_drop_geometry(san_andreas), por, FUN = vincenty) |> head()

Run the code above in your browser using DataLab