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

Add ncells argument for global(x, fun=quantile) #1213

Closed
ailich opened this issue Jun 29, 2023 · 1 comment
Closed

Add ncells argument for global(x, fun=quantile) #1213

ailich opened this issue Jun 29, 2023 · 1 comment

Comments

@ailich
Copy link
Contributor

ailich commented Jun 29, 2023

In terra to get quantiles across cells for a layer you can use terra::global(x, fun=quantile). In raster this was done using raster::quantile. For large rasters this can take a long time or fail since I believe determining quantiles requires reading all values into memory. raster::quantile had an ncells argument to allow for a random sample of a specified size to be used instead. Perhaps this could be added if quantile is used as the function, or perhaps even better as an argument to global more generally.

@rhijmans
Copy link
Member

rhijmans commented Jul 4, 2023

Thanks. global has a new argument "maxcell"

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