distance_point: Add the distances to a point from each coordinate

Description Usage Arguments Value Credit Author(s) See Also Examples

View source: R/distance_point.R

Description

Add the distances to a point from each coordinate

Usage

1
2
3
distance_point(
  tracks, point, bind = TRUE, drop = TRUE, cname = "dis_to_point_in_m"
)

Arguments

tracks

psyo. Data frame with tracks.

point

list. A list, matrix or data.frame with the columns lon (numeric) and lat (numeric) and one row.

bind

logical. Return the distance as list (FALSE) or add it to tracks (TRUE).

drop

logical. If TRUE drop the data frame and return value as vector or list.

cname

character. Column name of the returned calculation result.

Value

psyo

Credit

If you use 'psyosphere' for commercial use or research, please support us by include one off the following references:

Author(s)

Benjamin Ziepert. Please send feedback to: feedback-psyosphere@analyse-gps.com.

See Also

distance_line,distance_peers, distance_psyo

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## Not run: 
data(psyo)

# Un-named list
point <- c(4.936197, 52.314701)
distance_point(psyo[1,], point, bind = FALSE)

# Named list
point <- c(lat = 52.314701, lon = 4.936197)
distance_point(psyo[1,], point, bind = FALSE)

# Multiple distance to point
coordinates <- distance_point(psyo, point)

## End(Not run)

psyosphere documentation built on July 2, 2020, 12:08 a.m.