Skip to content

Commit

Permalink
Moves get_units to internal
Browse files Browse the repository at this point in the history
  • Loading branch information
eliocamp committed Sep 24, 2024
1 parent 5a07c98 commit 8722dde
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions R/WriteNetCDF.R
Original file line number Diff line number Diff line change
Expand Up @@ -62,22 +62,27 @@ WriteNetCDF <- function(data, file, vars, dims = NULL) {
return(invisible(file))
}

#' @keywords internal
get_units <- function(x) {
UseMethod("get_units")
}

#' @keywords internal
get_units.default <- function(x) {
return("")
}

#' @keywords internal
get_units.Date <- function(x) {
return("days since 1970-01-01 00:00:00")
}

#' @keywords internal
get_units.POSIXlt <- function(x) {
return("seconds since 1970-01-01 00:00:00")
}

#' @keywords internal
get_units.POSIXct <- function(x) {
return("seconds since 1970-01-01 00:00:00")
}
Expand Down

0 comments on commit 8722dde

Please sign in to comment.