-
Notifications
You must be signed in to change notification settings - Fork 8
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
Problems with "'x' and 'y' must be given in ascending order" after using subsetGrid #35
Comments
Hi Rocio,
Could you please share to us some data so we can reproduce the error? Also
the chunk of code you are running please.
Thank you!
Jorge
El jue, 26 nov 2020 a las 1:55, Rocio B (<[email protected]>)
escribió:
… Hi,
Im using subsetGrid function to select some stations. Then I want to
calculate bias, or correlations using valueMeasure from package
climate4R.value but I get this error:
[2020-11-26 01:32:58] Computing member 1 out of 11
Error in mat2Dto3Darray(mat, xy$x, xy$y) :
Coordinates 'x' and 'y' must be given in ascending order
Im not very clear what the problem is,maybe you can guide me. The error
only appears when I use subsetGrid first.
Thanks a lot :)
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#35>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AE4DRYJEQNV2EIOSUFDESU3SRWROPANCNFSM4UDCILZA>
.
|
Thanks Jorge for your quick response. I realized that I was a bit confused about the error. I think I have two different problems. I attach some data with 2 objects that are BindGrids after using downscale.CV: 1 analog and 1 GLM This is my code: ############################################ GLM |
Hi Rocio,
Maybe I am missing the error or not understanding it correctly. If I run
the following chunk of code I do not find any errors (note that I am
commenting the 'attributes' lines to show that you do not need to touch
them manually).
#########analogs in Region 1
ANOM_ERA_analogos.cv_R1=scaleGrid(ERA_analogos.cv_Tn_R1_tt,time.frame =
"daily")
ANOM_cor_ERA.cv_R1=valueMeasure(subsetDimension(ANOM_ERA_analogos.cv_R1,dimension
= "member", indices =1),subsetDimension(ANOM_ERA_analogos.cv_R1,dimension =
"member", indices = c(2:3)), measure.code =
"ts.rp",return.NApercentage=FALSE)
############################################ GLM
estaciones_grupo1=c( "10178", "10332", "10221", "10156", "10204", "10190",
"10159", "10166",
"10334", "10134", "10453", "10170","10148", "10210",
"10369", "10113",
"10456", "10206", "10177", "10133", "10154", "10192",
"10451", "10311",
"10490", "10446", "10400", "10216", "10900", "10358",
"10902", "10421",
"10502", "10907", "10114", "10145", "10492", "10912")
# tt=attributes(ERA_GLM_cv_tt$Data)
anom_modelos_ERA_GLM.cv=scaleGrid(grid=ERA_GLM_cv_tt,base=ERA_GLM_cv_tt,time.frame
= "daily")
# attributes(anom_modelos_ERA_GLM.cv$Data)=tt
ANOM_ERA_GLM.cv_R1=subsetGrid(anom_modelos_ERA_GLM.cv,station.id =
estaciones_grupo1)
ANOM_cor_ERA_GLM.cv_R1=valueMeasure(subsetDimension(ANOM_ERA_GLM.cv_R1,dimension
= "member", indices =1),subsetDimension(ANOM_ERA_GLM.cv_R1,dimension =
"member", indices = c(2:3)), measure.code =
"ts.rp",return.NApercentage=FALSE)#, measure.cor(deseason = 1, method =
pearson))
Am I missing something?
Jorge
El vie, 27 nov 2020 a las 23:56, Rocio B (<[email protected]>)
escribió:
… Thanks Jorge for your quick response. I realized that I was a bit confused
about the error. I think I have two different problems. I attach some data
with 2 objects that are BindGrids after using downscale.CV: 1 analog and 1
GLM
In the case of analogs, I already have them in a specific region, and the
error come up after ScaleGrid .
In the case of the GLM that I have them in a larger domain, I first
calculate the anomalies but then I cannot select the stations. I was able
to solve it by changing the attributes of the data matrix.
I hope it is understood, and thank you very much!
This is my code:
`#########analogs in Region 1
ANOM_ERA_analogos.cv_R1=scaleGrid(ERA_analogos.cv_Tn_R1_tt,time.frame =
"daily")
ANOM_cor_ERA.cv_R1=valueMeasure(subsetDimension(ANOM_ERA_analogos.cv_R1,dimension
= "member", indices =1),subsetDimension(ANOM_ERA_analogos.cv_R1,dimension =
"member", indices = c(2:3)), measure.code =
"ts.rp",return.NApercentage=FALSE)
############################################ GLM
estaciones_grupo1=c( "10178", "10332", "10221", "10156", "10204", "10190",
"10159", "10166",
"10334", "10134", "10453", "10170","10148", "10210", "10369", "10113",
"10456", "10206", "10177", "10133", "10154", "10192", "10451", "10311",
"10490", "10446", "10400", "10216", "10900", "10358", "10902", "10421",
"10502", "10907", "10114", "10145", "10492", "10912")
tt=attributes(ERA_GLM_cv_tt$Data)
anom_modelos_ERA_GLM.cv=scaleGrid(grid=ERA_GLM_cv_tt,base=ERA_GLM_cv_tt,time.frame
= "daily")
attributes(anom_modelos_ERA_GLM.cv$Data)=tt
ANOM_ERA_GLM.cv_R1=subsetGrid(anom_modelos_ERA_GLM.cv,station.id =
estaciones_grupo1)
ANOM_cor_ERA_GLM.cv_R1=valueMeasure(subsetDimension(ANOM_ERA_GLM.cv_R1,dimension
= "member", indices =1),subsetDimension(ANOM_ERA_GLM.cv_R1,dimension =
"member", indices = c(2:3)), measure.code =
"ts.rp",return.NApercentage=FALSE)#, measure.cor(deseason = 1, method =
pearson))
`
example.zip
<https://github.com/SantanderMetGroup/transformeR/files/5609762/example.zip>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#35 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AE4DRYNVHY34P2GG2P5UZNTSSAVCXANCNFSM4UDCILZA>
.
|
Thank u Jorge, I was able to solve the problem by reinstalling transformeR to version 2.0.1 after heeding this warning: WARNING: Your current version of transformeR (v2.0.2) is ahead of the master branch version (2.0.1) |
Hi,
Im using subsetGrid function to select some stations. Then I want to calculate bias, or correlations using valueMeasure from package climate4R.value but I get this error:
[2020-11-26 01:32:58] Computing member 1 out of 11
Error in mat2Dto3Darray(mat, xy$x, xy$y) :
Coordinates 'x' and 'y' must be given in ascending order
Im not very clear what the problem is,maybe you can guide me. The error only appears when I use subsetGrid first.
Thanks a lot :)
The text was updated successfully, but these errors were encountered: