Error when using the Settle matrix in the latest R #40
-
I have recently just updated my version of R and reinstalled RangeshifterR. After attempting to run my simulation I keep getting the follwoing error relating to my Settle matrix. Error in validObject(s) : The same code worked before the R update. I have tried adding half-open intervals but I keep getting the same the error. For reference here is my settlement matrix code. Settle1 <- matrix(c(0,0,1,-7,0.5,0,1,1,-7,0.5,1,0,0,0,0,1,1,0,0,0,2,0,0,0,0,2,1,0,0,0), byrow = TRUE, ncol = 5) Would really appreciate any help, or a pointer as to where I can find the solution ? Many thanks, Josh |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Dear Josh, the error message is saying that column 3 of the settlement matrix, which contains the values the maximum settlement probability S0 (see the help ?Settlement if you don't know what this is referring to), can only contain values in the half-open interval (0,1], that is: 0 < S0 ≤ 1. Specifically, zero is not allowed. This is the case because individuals would never settle and eternally disperse once they have emigrated. Therefore, you will have to set these values to strictly positive ones. (Note that if the stages concerned (i.e. 1 and 2) have zero emigration probabilities, the values in these rows will have no effect on the simulation result, anyways.) Not sure why it didn't complain before your update, maybe you had on older version of RangeShiftR that didn't properly check the matrix values. All the best, |
Beta Was this translation helpful? Give feedback.
-
Dear Anne,
Thank you for the fast reply. That explanation makes sense, and my code now
works.
Yes it could be, as since RangeshifteR became available, I haven't updated
it at all.
Best regards,
Josh
Am Di., 20. Juni 2023 um 18:16 Uhr schrieb Anne-Kathleen Malchow <
***@***.***>:
… Dear Josh,
the error message is saying that column 3 of the settlement matrix, which
contains the values the maximum settlement probability S0 (see the help
?Settlement if you don't know what this is referring to), can only contain
values in the half-open interval (0,1], that is: 0 < S0 ≤ 1. Specifically,
zero is not allowed. This is the case because individuals would never
settle and eternally disperse once they have emigrated. Therefore, you will
have to set these values to strictly positive ones. (Note that if the
stages concerned (i.e. 1 and 2) have zero emigration probabilities, the
values in these rows will have no effect on the simulation result, anyways.)
Not sure why it didn't complain before your update, maybe you had on older
version of RangeShiftR that didn't properly check the matrix values.
All the best,
Anne
—
Reply to this email directly, view it on GitHub
<#40 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AVLODM7QB72CDAGEL5JAL3LXMHEGHANCNFSM6AAAAAAZNMRU7Q>
.
You are receiving this because you authored the thread.Message ID:
<RangeShifter/RangeshiftR-tutorials/repo-discussions/40/comments/6232700@
github.com>
|
Beta Was this translation helpful? Give feedback.
Dear Josh,
the error message is saying that column 3 of the settlement matrix, which contains the values the maximum settlement probability S0 (see the help ?Settlement if you don't know what this is referring to), can only contain values in the half-open interval (0,1], that is: 0 < S0 ≤ 1. Specifically, zero is not allowed. This is the case because individuals would never settle and eternally disperse once they have emigrated. Therefore, you will have to set these values to strictly positive ones. (Note that if the stages concerned (i.e. 1 and 2) have zero emigration probabilities, the values in these rows will have no effect on the simulation result, anyways.)
Not sure why it didn't co…