f_distance: Calculate distances

View source: R/f - Distance.R

f_distanceR Documentation

Calculate distances

Description

Calculates distances.

Usage

f_distance(x1, y1 = NULL, x2 = NULL, y2 = NULL)

Arguments

x1, y1

Coordinates of first point (default: y1 = NULL).

x2, y2

Coordinates of second point (default: x2, y2 = NULL).

Details

In case a single vector of 4 elements is provided, then x1, x2, x2, and y2 are reassigned using x1.

Value

Vector with distances.

Author(s)

Pieter Overdevest

Examples

v.distance <- f_distance(

    x1 = c(1 ,1),
    y1 = c(1, 2),
    x2 = c(3, 3),
    y2 = c(4, 5)
)

pieterov/generaltoolbox documentation built on Jan. 25, 2025, 10:32 a.m.