Skip to content
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 from coops_search(product = "predictions") for any time zone argument other than "gmt" #342

Closed
Maggie-Mason opened this issue Mar 2, 2020 · 3 comments
Labels
Milestone

Comments

@Maggie-Mason
Copy link

Maggie-Mason commented Mar 2, 2020

I have a nearly identical script using product = "water_level", time_zone = "lst_ldt" with no issue. Trying to request tide predictions with any time zone argument other than "gmt" produces the error at the bottom. Currently I can request it as GMT then convert the datetime to EST, but that means my data call is starting and ending a quarter day off from what I want for my EST station.

> may.tides <- (coops_search(station_name = 8551762, 
+                                           begin_date = 20200501, end_date = 20200531, 
+                                           datum = "mtl", product = "predictions", units = "metric", time_zone = "lst_ldt"))

Error in if (!repeated && grepl("%[[:xdigit:]]{2}", URL, useBytes = TRUE)) return(URL) : 
  missing value where TRUE/FALSE needed
@sckott
Copy link
Contributor

sckott commented Mar 3, 2020

Can you please share your sessionInfo() (or devtools::session_info()) as requested

@Maggie-Mason
Copy link
Author

R version 3.6.2 (2019-12-12)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18362)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252    LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                           LC_TIME=English_United States.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] rnoaa_0.9.5

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.3       pillar_1.4.3     compiler_3.6.2   geonames_0.999   tools_3.6.2      digest_0.6.25    jsonlite_1.6.1  
 [8] lubridate_1.7.4  lifecycle_0.1.0  tibble_2.1.3     gtable_0.3.0     pkgconfig_2.0.3  rlang_0.4.5      rstudioapi_0.11 
[15] crul_0.9.0       curl_4.3         gridExtra_2.3    dplyr_0.8.4      stringr_1.4.0    xml2_1.2.2       vctrs_0.2.3     
[22] rappdirs_0.3.1   triebeard_0.3.0  grid_3.6.2       tidyselect_1.0.0 glue_1.3.1       httpcode_0.2.0   R6_2.4.1        
[29] XML_3.99-0.3     ggplot2_3.2.1    purrr_0.3.3      tidyr_1.0.2      hoardr_0.5.2     magrittr_1.5     urltools_1.7.3  
[36] scales_1.1.0     assertthat_0.2.1 colorspace_1.4-1 stringi_1.4.6    lazyeval_0.2.2   munsell_0.5.0    rjson_0.2.20    
[43] crayon_1.3.4

I've double checked with the script to see if it was this specific product producing the error:

#"Predictions" product with time zone other than gmt arguments
> march.tides <- as.data.frame(coops_search(station_name = 8551762, 
+                                           begin_date = 20200301, end_date = 20200331, 
+                                           datum = "mtl", product = "predictions", units = "metric", time_zone = "lst"))
Error in if (!repeated && grepl("%[[:xdigit:]]{2}", URL, useBytes = TRUE)) return(URL) : 
  missing value where TRUE/FALSE needed

> march.tides <- as.data.frame(coops_search(station_name = 8551762, 
+                                           begin_date = 20200301, end_date = 20200331, 
+                                           datum = "mtl", product = "predictions", units = "metric", time_zone = "lst_ldt"))
Error in if (!repeated && grepl("%[[:xdigit:]]{2}", URL, useBytes = TRUE)) return(URL) : 
  missing value where TRUE/FALSE needed
> #Different product "water_level" with non-gmt time zone argument
> march.tides <- as.data.frame(coops_search(station_name = 8551762, 
+                                           begin_date = 20200301, end_date = 20200331, 
+                                           datum = "mtl", product = "water_level", units = "metric", time_zone = "lst_ldt"))

@sckott sckott added the bug label Mar 4, 2020
@sckott sckott added this to the v0.9.6 milestone Mar 4, 2020
@sckott sckott closed this as completed in 6f1c262 Mar 4, 2020
@sckott
Copy link
Contributor

sckott commented Mar 4, 2020

@Maggie-Mason try again after reinstalling - should work now.

predictions gives no information with which to adjust time zone - so we just skip that in this case

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants