ortho.proj: ortho.proj

Description Usage Arguments Value Examples

View source: R/ortho.proj.R

Description

Calculates the x and y coordinates along an orthogonal plane, given the linear regression coefficients of y~x

Usage

1
ortho.proj(x, y, m, b)

Arguments

x

A vector of X geographic coordinates

y

A vector of Y geographic coordinates

m

Slope parameter from linear regression of y~x

b

Intercept parameter from linear regression of y~x

Value

A data.frame containing projected x and y coordinates (xProj and yProj). The number of rows equals the number of observations in x.

Examples

1
2
3
4
5
6
data(vels)
vels.t1 <- vels[transectName=="t1",,]
plot(UTM_Y~UTM_X, vels.t1)
linmod <- lm(vels.t1$UTM_Y~vels.t1$UTM_X)
projected <- ortho.proj(vels.t1$UTM_X, vels.t1$UTM_Y, linmod$coefficients[2], linmod$coefficients[1])
plot(projected)

jasonfischer/rivSurveyR documentation built on May 18, 2019, 5:54 p.m.