inst/Examples/speedGPS.R

speedGPS <- function(xyz, time, rOut = c(.25, .75), naValue = .25) {
    speed <-  trackSpeed(xyz, time)
    rIn <- range(speed, na.rm = TRUE)
    value <- diff(rOut) * (speed - rIn[1])/diff(rIn) + rOut[1]
    ifelse(is.na(value), rep(naValue, length(value)), value)
}

Try the SoDA package in your browser

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

SoDA documentation built on Oct. 28, 2020, 9:07 a.m.