Skip to content
Permalink
Browse files

add vpi method to check_night

  • Loading branch information
adokter committed Apr 10, 2020
1 parent 7c553d5 commit 23def64daf1cf546b36986ebe84d09168f0b36eb
Showing with 16 additions and 6 deletions.
  1. +12 −2 R/check_night.R
  2. +4 −4 man/check_night.Rd
@@ -2,10 +2,10 @@
#'
#' Checks if it is night (\code{TRUE}/\code{FALSE}) for a combination of
#' latitude, longitude, date and sun elevation. When used on a bioRad object
#' (\code{pvol}, \code{vp}, \code{vpts}) this information is extracted from the
#' (\code{pvol}, \code{vp}, \code{vpts}, \code{vpi}) this information is extracted from the
#' bioRad object directly.
#'
#' @param x \code{pvol}, \code{vp} or \code{vpts},
#' @param x \code{pvol}, \code{vp}, \code{vpts}, \code{vpi},
#' or a date inheriting from class \code{POSIXct} or a string
#' interpretable by \link{as.POSIXct}.
#' @param lon numeric. Longitude in decimal degrees.
@@ -149,6 +149,16 @@ check_night.vpts <- function(x, ..., elev = -0.268, offset = 0) {
)
}

#' @rdname check_night
#'
#' @export
check_night.vpi <- function(x, ..., elev = -0.268, offset = 0) {
stopifnot(inherits(x, "vpi"))
check_night(x$datetime, attributes(x)$lon, attributes(x)$lat,
elev = elev, offset = offset
)
}
?
#' @rdname check_night
#'
#' @export

Some generated files are not rendered by default. Learn more.

0 comments on commit 23def64

Please sign in to comment.
You can’t perform that action at this time.