-
Notifications
You must be signed in to change notification settings - Fork 96
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
Incorporar operaciones entre 2 o más pilas SpatRaster #1029
Comments
entoendo que antes para esto se utilizaba la función overlay, pero ya no encuentro esta función S4 method for SpatRaster,SpatRasteroverlay(x, y, fun, ..., filename="", overwrite=FALSE, wopt=list()) |
This site is to report bugs and request new functionality. For general questoins I suggest you use stackoverflow. You can do something like this:
But seeing this, I think I will add a new method
|
Muchas gracias!
Saluda cordialmente
Guillermo S. Fuentes Jaque
Ing. en Recursos Naturales Ren.
Ms. Gestión Territorial de Rec. Nat.
UNIVERSIDAD DE CHILE
El mié, 22 feb 2023 a las 1:21, Robert Hijmans ***@***.***>)
escribió:
… This site is to report bugs and request new functionality. For general
questoins I suggest you use stackoverflow <https://stackoverflow.com/>.
You can do something like this:
library(terra)
s <- rast(system.file("ex/logo.tif", package="terra"))
set.seed(1)
r <- setValues(s, runif(size(s), 100, 200))
xcor = app(c(s, r), fun=\(x)cor(x[1:3], x[4:6]))
xreg = app(c(s, r), fun=\(x) coefficients(lm(x[4:6] ~ x[1:3])))
But seeing this, I think I will add a new method capp that would allow for
capp(s, r, fun=cor)
capp(s, r, fun=\(x,y) coefficients(lm(y~x)))
—
Reply to this email directly, view it on GitHub
<#1029 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHVBVS6D5TFP4I6YLHNVUX3WYWH6BANCNFSM6AAAAAAVDYRKQA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
This can now be done more elegantly with
|
Estoy intentando realizar operaciones cómo correlación o regresión entre dos series de tiempo (pilas SpatRaster). En este caso, 16 capas de NDVI y 16 capas de Precipitación. Para el caso de la correlación el resultado esperado son dos capas SpatRaster (coeficiente de correlación y valor p), mientras que, para la regresión, el resultado esperado son tres capas SpatRaster (intercepto, pendiente y coeficiente de determinación). ¿Hay alguna forma de implementar estas operaciones?
The text was updated successfully, but these errors were encountered: