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

get_downloads() returns data from the same site n times #45

Open
UgoBisson opened this issue May 20, 2024 · 2 comments
Open

get_downloads() returns data from the same site n times #45

UgoBisson opened this issue May 20, 2024 · 2 comments

Comments

@UgoBisson
Copy link

When I select data thanks to get_sites() and then get_datasets(), I effectively get what I want: data for the n sites which respect my criteria. But then, when I run get_downloads() based on the same set of sites, I get n identical lists containing samples for the same site.

For instance if I run the following chunk, directly took from the page neotoma2_R_pack_doc, I get samples for the right number of sites (7) but I get 7 times the data for the same site (Lake Valencia):

brazil <- '{"type": "Polygon", 
            "coordinates": [[
                [-73.125, -9.102],
                [-56.953, -33.138],
                [-36.563, -7.711],
                [-68.203, 13.923],
                [-73.125, -9.102]
              ]]}'

# We can make the geojson a spatial object if we want to use the
# functionality of the `sf` package.
brazil_sf <- geojsonsf::geojson_sf(brazil)

brazil_records <- get_datasets(loc = brazil_sf) %>%
  neotoma2::filter(datasettype == "pollen" & age_range_young <= 1000 & age_range_old >= 10000) %>%
  get_downloads(verbose = FALSE)

With get_sites() or get_datasets(), I obtain in my environment a list of lists structured this way:
-sites

  • -[[1]]
  • -[[2]]
  • -[[3]]
    etc.

While with get_downloads(), I get:
-sites

  • -site
  • -site
  • -site
    etc.
@sedv8808
Copy link
Collaborator

Hello, are you running the latest version of Neotoma2 from CRAN?

I have rerun the chunk of code you mention with no problems. To update, do:

install.packages('neotoma2')

I have updated the production branch to match CRAN's branch.

@UgoBisson
Copy link
Author

Hello @sedv8808,
Thank you for your answer. Unfortunately I still meet the same issue updating "neotoma2". I am using R 4.3.3 (2024-02-29 ucrt) and the latest version of neotoma2 (1.0.3).
I am working from China (Beijing). Initially, I had to deal with some problems to retrieve data from "neotoma2" and still have to work in particular conditions (using VPN, specific Wi-Fi and modified R profile on my project) but as the other functions of the "neotoma2" R package are working well, I don't understand why get_downloads is still not working.
Any suggestion is really welcome.

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

No branches or pull requests

2 participants