Cal.recon: Calculating reconstruction error

Description Usage Arguments Details Value Author(s) Examples

View source: R/spherepc.R

Description

This function calculates reconstruction error.

Usage

1

Arguments

data

matrix or data frame consisting of spatial locations with two columns. Each row represents longitude and latitude.

line

longitude and latitude of a line as a matrix or data frame with two columns.

Details

This function calculates reconstruction error from the data to the line. Longitude should range from -180 to 180 and latitude from -90 to 90. This function requires to load 'geosphere' R package.

Value

summation of squared distance from the data to the line on the unit sphere.

Author(s)

Jongmin Lee

Examples

1
2
3
4
library(geosphere)           # This function needs to load 'geosphere' R packages.
data <- rbind(c(0, 0), c(50, -10), c(100, -70))
line <- rbind(c(30, 30), c(-20, 50), c(50, 80))
Cal.recon(data, line)

spherepc documentation built on Oct. 7, 2021, 9:14 a.m.

Related to Cal.recon in spherepc...