Skip to content

Commit

Permalink
explicit utils::tail() call in internal.R
Browse files Browse the repository at this point in the history
  • Loading branch information
dklinges9 committed Jan 24, 2022
1 parent 8e60f12 commit 4a4e607
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/internal.R
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ nc_to_df <- function(nc, long, lat, start_time, end_time, dtr_cor = FALSE,
}

# Check if end_time is before last time observation
end <- lubridate::ymd_hms("1900:01:01 00:00:00") + (tail(nc_dat$dim$time$vals, n = 1) * 3600)
end <- lubridate::ymd_hms("1900:01:01 00:00:00") + (utils::tail(nc_dat$dim$time$vals, n = 1) * 3600)
if (end_time > end) {
stop("Requested end time is after the end of time series of the ERA5 netCDF.")
}
Expand Down Expand Up @@ -225,7 +225,7 @@ nc_to_df_precip <- function(nc, long, lat, start_time, end_time) {
}

# Check if end_time is before last time observation
end <- lubridate::ymd_hms("1900:01:01 00:00:00") + (tail(nc_dat$dim$time$vals, n = 1) * 3600)
end <- lubridate::ymd_hms("1900:01:01 00:00:00") + (utils::tail(nc_dat$dim$time$vals, n = 1) * 3600)
if (end_time > end) {
stop("Requested end time is after the end of time series of the ERA5 netCDF.")
}
Expand Down

0 comments on commit 4a4e607

Please sign in to comment.