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

How to access the data using R? #625

Open
Freestyleyang opened this issue Jul 29, 2022 · 1 comment
Open

How to access the data using R? #625

Freestyleyang opened this issue Jul 29, 2022 · 1 comment
Labels

Comments

@Freestyleyang
Copy link

Hi there,
Thank you for developing the downscaled CMIP6 dataset! Is it possible to access the data using R? Could you please share some example codes?

@Freestyleyang Freestyleyang changed the title How to acces the data using R? How to access the data using R? Jul 29, 2022
@delgadom
Copy link
Member

delgadom commented Aug 2, 2022

Thanks for your question and interest!

Unfortunately, this looks like it's still tricky. zarr support for R is being worked on, but it looks like it's in it's early stages. See this issue on zarr-developers: zarr-developers/community#18

There is an example of reading from the STAC collection with R here: https://github.com/microsoft/PlanetaryComputerExamples/blob/main/quickstarts/reading-stac-r.ipynb

One thing you could do is to download a subset of the data in python, save to netCDF or something with better R support, and then open it locally in R. You could read in the data with xarray as we show in the examples and then save to netcdf with xr.Dataset.to_netcdf, e.g.:

ds.to_netcdf("local_filepath.nc")

The access to the data is provided by https://github.com/microsoft/PlanetaryComputer, so that's a good place to go for general access & support questions.

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

3 participants