commit 207bc493c6e269dad55a1dd108c290d0bb96c0a1
parent 90466f1d9771389b507f05f01ef799d5e25c64f1
Author: eamoncaddigan <eamon.caddigan@gmail.com>
Date: Fri, 16 Sep 2016 14:53:40 -0400
No need to requireNamespace() for flightpathr
Diffstat:
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/R/createTrajectory.R b/R/createTrajectory.R
@@ -56,12 +56,8 @@ createTrajectory <- function(longitude, latitude, altitude = 0, timestamp = NULL
# Use flightpathr to calculate bearing between successive points if not
# specified.
if (is.null(bearing)) {
- if (requireNamespace("flightpathr", quietly = TRUE)) {
- bearing <- flightpathr::coordsToBearing(cbind(coords, altitude))
- bearing[nCoord] <- bearing[nCoord-1]
- } else {
- stop("Package \"flightpathr\" must be installed or bearing must be specified")
- }
+ bearing <- flightpathr::coordsToBearing(cbind(coords, altitude))
+ bearing[nCoord] <- bearing[nCoord-1]
} else {
checkLength(bearing)
}