R/twoDirections.R

Defines functions `twoDirections`

`twoDirections` <-
function(x,w) {
zinc<-pava(x,w); zdec<--pava(-x,w)
sinc<-sum(w*(zinc-x)^2); sdec<-sum(w*(zdec-x)^2)
if (sinc < sdec) return(zinc) else return(zdec)
}

Try the aspect package in your browser

Any scripts or data that you put into this service are public.

aspect documentation built on May 6, 2022, 9:06 a.m.