?s 23:47 de 31/01/2024, Roy Mendelssohn - NOAA Federal via R-help
escreveu:> HI All:
>
> We are trying to figure out a problem that is occurring with a package,
and we need a non-NOAA person with a Windows computer with the latest R to test
for us what is failing (but works on Macs and Linux from different sites). Part
of the problem is there is an Akamai service in between that we feel may be
messing up things. To do this you would need to be willing to:
>
> 1. install the ?rerddap? package from CRAN, with all dependencies - or if
installed make certain it is the latest
>
> 2. make certain that the packages ?curl?, ?crul? and ?http? are up to date.
>
> 3. Run the following:
>
> # load rerddap
> library("rerddap?)
> # delete rerddap cache just in case
> cache_delete_all()
> # get the data extract
> dat <- tabledap('FED_JSATS_detects', url =
"https://oceanview.pfeg.noaa.gov/erddap/",
'study_id="RBDD_2018"', callopts = list(verbose = TRUE), store
= memory())
>
> 4. If it works also do:
>
> head(dat)
>
> Either way if all the output could be sent to me it would be very helpful.
The download may take a couple of minutes,
> the file size is about 3.5MB.
>
> If anyone has concerns about what is being downloaded you can check the
?rerddap? docs to see these are all legitimate ?rerddap' commands, the
datasets being accessed is
https://oceanview.pfeg.noaa.gov/erddap/tabledap/FED_JSATS_detects.html. The
downloaded file goes to R temp space, and its location, if successful is given
in the output.
>
> Thanks to anyone willing to help. One of my issues is I have been unable
to reproduce the error, but I also do not have ready access to a Windows
machine.
>
> -ROy
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
Hello,
Tested with R 4.3.2 running on Windows 11.
1. You mention package http but there is no package http on CRAN, did
you mean package httr?
2. I wrote a script rhelp.R, ran it on a command window and here is what
I got on the command window output.
C:\Users\ruipb\Documents>R -q -f rhelp.R > rhelp_out.txt
* WARNING: failed to open cookie file ""
* Found bundle for host: 0x21cb7410670 [serially]
* Can not multiplex, even if we wanted to
* Re-using existing connection with host oceanview.pfeg.noaa.gov
> GET
/erddap/tabledap/FED_JSATS_detects.csv?&study_id%3D%22RBDD_2018%22 HTTP/1.1
Host: oceanview.pfeg.noaa.gov
User-Agent: libcurl/8.3.0 r-curl/5.2.0 crul/1.4.0
Accept-Encoding: gzip, deflate
Accept: application/json, text/xml, application/xml, */*
< HTTP/1.1 504 Gateway Time-out
< Server: AkamaiGHost
< Mime-Version: 1.0
< Content-Type: text/html
< Content-Length: 176
< Expires: Thu, 01 Feb 2024 09:56:40 GMT
< Date: Thu, 01 Feb 2024 09:56:40 GMT
< Connection: keep-alive
< Strict-Transport-Security: max-age=31536000
<
* Connection #0 to host oceanview.pfeg.noaa.gov left intact
3. The file rhelp_out.txt was created and its contents are the
following. (I installed package "hoardr" separately because for some
reason it was not being recognized as a dependency)
> # pkgs <- c("hoardr", "rerddap", "curl",
"crul", "httr")
> # utils::install.packages(
> # pkgs = pkgs,
> # lib = .libPaths()[1],
> # repos = "https://cloud.r-project.org",
> # dependencies = TRUE
> # )
>
> # load rerddap
> library("rerddap")
> # delete rerddap cache just in case
> cache_delete_all()
> # get the data extract
> dat <- tryCatch(
+ tabledap(
+ 'FED_JSATS_detects',
+ url = "https://oceanview.pfeg.noaa.gov/erddap/",
+ 'study_id="RBDD_2018"',
+ callopts = list(verbose = TRUE),
+ store = memory()
+ ),
+ warning = function(w) w,
+ error = function(e) e,
+ finally = print("download end")
+ )
[1] "download end"
>
> # 4. If it works also do:
> head(dat)
$message
[1] ""
$call
NULL
>
> str(dat)
List of 2
$ message: chr ""
$ call : NULL
- attr(*, "class")= chr [1:3] "simpleError"
"error" "condition"
>
> sessionInfo()
R version 4.3.2 (2023-10-31 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 11 x64 (build 22621)
Matrix products: default
locale:
[1] LC_COLLATE=Portuguese_Portugal.utf8
LC_CTYPE=Portuguese_Portugal.utf8
[3] LC_MONETARY=Portuguese_Portugal.utf8 LC_NUMERIC=C
[5] LC_TIME=Portuguese_Portugal.utf8
time zone: Europe/Lisbon
tzcode source: internal
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] rerddap_1.1.0
loaded via a namespace (and not attached):
[1] vctrs_0.6.3 cli_3.6.1 rlang_1.1.1 ncdf4_1.22
[5] crul_1.4.0 generics_0.1.3 jsonlite_1.8.7
data.table_1.14.8
[9] glue_1.6.2 httpcode_0.3.0 triebeard_0.4.1 fansi_1.0.5
[13] rappdirs_0.3.3 tibble_3.2.1 hoardr_0.5.4 lifecycle_1.0.4
[17] compiler_4.3.2 dplyr_1.1.3 Rcpp_1.0.12 pkgconfig_2.0.3
[21] digest_0.6.33 R6_2.5.1 tidyselect_1.2.0 utf8_1.2.4
[25] pillar_1.9.0 curl_5.2.0 magrittr_2.0.3 urltools_1.7.3
[29] xml2_1.3.5
>
So there was an unspecified error, an error without a condition message
and no call expression. I find this stranger, a call like the following
is expected.
tryCatch(stop("error"), error = function(e) e) |> str()
List of 2
$ message: chr "error"
$ call : language doTryCatch(return(expr), name, parentenv, handler)
- attr(*, "class")= chr [1:3] "simpleError"
"error" "condition"
Function tabledap doesn't seem to be handling errors properly.
Hope this helps,
Rui Barradas
--
Este e-mail foi analisado pelo software antiv?rus AVG para verificar a presen?a
de v?rus.
www.avg.com