mt-climate-office / thredds

Access to THREDDS Servers
Other
2 stars 0 forks source link

Error in tds_list_datasets(): Error: `.x` must be a vector, not a function #1

Open edwardlavender opened 4 years ago

edwardlavender commented 4 years ago

I wanted to list the datasets on this url: "https://thredds.sams.ac.uk/thredds/".

I used the following code:

datasets <- tds_list_datasets(thredds_url = "https://thredds.sams.ac.uk/thredds/")

I receive the following error:

Error: .x must be a vector, not a function Run rlang::last_error() to see where the error occurred.

Running rlang::last_error() produces the following output: <error/purrr_error_bad_type> .x must be a vector, not a function Backtrace:

  1. thredds::tds_list_datasets(thredds_url = "https://thredds.sams.ac.uk/thredds/")
    1. purrr:::stop_bad_type(...) Run rlang::last_trace() to see the full context.

Running rang::last_trace() produces this context: <error/purrr_error_bad_type> .x must be a vector, not a function Backtrace: █

  1. ├─thredds::tds_list_datasets(thredds_url = "https://thredds.sams.ac.uk/thredds/")
  2. │ └─%>%(...)
  3. │ ├─base::withVisible(eval(quote(_fseq(_lhs)), env, env))
  4. │ └─base::eval(quote(_fseq(_lhs)), env, env)
  5. │ └─base::eval(quote(_fseq(_lhs)), env, env)
  6. │ └─thredds:::_fseq(_lhs)
  7. │ └─magrittr::freduce(value, _function_list)
  8. │ └─function_list[i]
  9. │ └─purrr::map_dfr(...)
    1. │ └─purrr::map(.x, .f, ...)
    2. └─purrr:::stop_bad_type(...)

I am using R version 4.0.2. Is this a bug or am I making an obvious mistake?

Thank you!

bocinsky commented 4 years ago

Hi there,

Sorry for the delay in getting back to you. I don’t think you are making a mistake. I noticed that the THREDDS server you are trying to access is the development version (v5.0.0-beta7), and I’m thinking there might be some breaking changes in that new version. I’ll continue to look into it more, what you are doing should be right.

Best, Kyle

On Jul 13, 2020, at 8:57 AM, Edward Lavender notifications@github.com wrote:

I wanted to list the datasets on this url: "https://thredds.sams.ac.uk/thredds/ https://thredds.sams.ac.uk/thredds/".

I used the following code:

datasets <- tds_list_datasets(thredds_url = "https://thredds.sams.ac.uk/thredds/") I receive the following error:

Error: .x must be a vector, not a function Run rlang::last_error() to see where the error occurred.

Running rlang::last_error() produces the following output: <error/purrr_error_bad_type> .x must be a vector, not a function Backtrace:

thredds::tds_list_datasets(thredds_url = "https://thredds.sams.ac.uk/thredds/ https://thredds.sams.ac.uk/thredds/") purrr:::stop_bad_type(...) Run rlang::last_trace() to see the full context. Running rang::last_trace() produces this context: <error/purrr_error_bad_type> .x must be a vector, not a function Backtrace: █

├─thredds::tds_list_datasets(thredds_url = "https://thredds.sams.ac.uk/thredds/ https://thredds.sams.ac.uk/thredds/") │ └─%>%(...) │ ├─base::withVisible(eval(quote(_fseq(_lhs)), env, env)) │ └─base::eval(quote(_fseq(_lhs)), env, env) │ └─base::eval(quote(_fseq(_lhs)), env, env) │ └─thredds:::_fseq(_lhs) │ └─magrittr::freduce(value, _function_list) │ └─function_list[i] <x-msg://6/value> │ └─purrr::map_dfr(...) │ └─purrr::map(.x, .f, ...) └─purrr:::stop_bad_type(...) I am using R version 4.0.2. Is this a bug or am I making an obvious mistake?

Thank you!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mt-climate-office/thredds/issues/1, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB7SSM6RJPXEVRNBBYVXF73R3MOGRANCNFSM4OYSDSAA.

morgane-pommier commented 1 year ago

Hi,

I know this is quite an old post, but did you manage to access this server in the end? I am trying to download data from the same SAMS thredds server, and I am getting the exact same error.

Thank you,

Morgane

edwardlavender commented 1 year ago

Hi,

I know this is quite an old post, but did you manage to access this server in the end? I am trying to download data from the same SAMS thredds server, and I am getting the exact same error.

Thank you,

Morgane

The fvcom.tbx package (https://github.com/edwardlavender/fvcom.tbx) contains two functions (thredds_download() and thredds_extract()) for accessing files on the SAMS thredds server. That package has not been updated recently, but I'm happy to look into any necessary updates depending on your requirements - just submit a separate issue in that repo.

morgane-pommier commented 1 year ago

Hi, I know this is quite an old post, but did you manage to access this server in the end? I am trying to download data from the same SAMS thredds server, and I am getting the exact same error. Thank you, Morgane

The fvcom.tbx package (https://github.com/edwardlavender/fvcom.tbx) contains two functions (thredds_download() and thredds_extract()) for accessing files on the SAMS thredds server. That package has not been updated recently, but I'm happy to look into any necessary updates depending on your requirements - just submit a separate issue in that repo.

Hi Edward ! Thanks for the link to your package, it worked perfectly !