-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: CCTZ: Unrecognized output timezone #12
Comments
Found the error. It's not lubridate::force_tz(
time = lubridate::ymd_hms("2020-01-01 01:00:00 UTC"),
tzone = "America/New_York"
)
#> Error: CCTZ: Unrecognized output timezone: "America/New_York"
function (date = NULL, lat = NULL, lon = NULL, data = NULL,
keep = c("solarNoon", "nadir", "sunrise", "sunset", "sunriseEnd",
"sunsetStart", "dawn", "dusk", "nauticalDawn", "nauticalDusk",
"nightEnd", "night", "goldenHourEnd", "goldenHour"),
tz = "UTC")
{
data <- .buildData(date = date, lat = lat, lon = lon, data = data)
if (!"Date" %in% class(data$date)) {
stop("date must to be a Date object (class Date)")
}
available_var <- c("solarNoon", "nadir", "sunrise", "sunset",
"sunriseEnd", "sunsetStart", "dawn", "dusk", "nauticalDawn",
"nauticalDusk", "nightEnd", "night", "goldenHourEnd",
"goldenHour")
stopifnot(all(keep %in% available_var))
data <- data %>% .[, `:=`(date, lubridate::force_tz(lubridate::as_datetime(date) +
lubridate::hours(12), Sys.timezone()))] %>% .[, `:=`((available_var),
.getTimes(date = date, lat = lat, lng = lon))] %>% .[,
c("date", "lat", "lon", keep), with = FALSE] %>% .[,
`:=`(date, as.Date(date))] %>% as.data.frame()
invisible(lapply(setdiff(colnames(data), c("date", "lat",
"lon")), function(x) attr(data[[x]], "tzone") <<- tz))
return(data)
} |
danielvartan
changed the title
Error: CCTZ: Unrecognized output timezone:
Error: CCTZ: Unrecognized output timezone
May 9, 2022
Everything is working as it should today... I installed R 4.2.0 yesterday, maybe it need a system restart to work properly. See this issue to learn more. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
I'm trying to run the package, but I keep getting the following error message.
Session info
Created on 2022-05-09 by the reprex package (v2.0.1)
Created on 2022-05-09 by the reprex package (v2.0.1)
The text was updated successfully, but these errors were encountered: