-
Notifications
You must be signed in to change notification settings - Fork 3
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
Error in h(simpleError(msg, call)) : error in evaluating the argument 'X' in selecting a method for function 'lapply': negative length vectors are not allowed #8
Comments
Could I get access to the input stock and indices objects? |
Sorry for the delay replying to you, but I was in a sea trip. I've attached the data you requested. |
@iagomosqueira I've attached the data you requested. |
There was some information missing for FLXSA to work. discards.n and discards.wt needs to be specified, as 0 if that is the case, and then catch.n and catch.wt updated. Also, the plusgroup needs to be set to match what FLXSA assumes, last age Please check if 0 and 4 are OK as minimum and maximum ages for fbar(). The ages considered to be fully selected should be used there. The example below sets them to 1 and 3, just as example. This code runs here, could you please check and let us know? Obviously the time series is pretty short, so results should be interpreted with caution. You could consider taking a look at FLa4a as a statistical model that can tell you quite a bit more about the quality of the fit and the information the data is really giving.
|
@iagomosqueira I tried considering your advices, however I get this error
|
I do not get that error. Could you please check what version of R, FLCore and FLXSA are you running?
Did you install from the FLR repository? |
platform x86_64-w64-mingw32
And yes, I install it from repository |
I am testing it now in R 4.0.3, on Windows 10 64 bit, packages re-installed from the FLR repository, and I do not get that error. Can you please save the objects created in your session
and post it here? |
The files are not different. I have also tested it with R 4.0.2 and it works here. Just to check things, does the FLXSA example run for you?
|
No
|
So nothing to do with your data then. What version of iterators do you have?
What do you get if you call
I think the call to iter inside an lapply is not dispatching correctly. |
packageVersion('iterators')
function (obj, ...) |
At this point I can only think of the option of installing R 4.0.3, just to have a clean R installation, and then install only iterators from CRAN and FLXSA from FLR. Is that possible for you? Your 4.0.2 installation will remain untouched. I am afraid it is very difficult for me to fix the problem when I cannot replicate it. |
R version 4.0.3 (2020-10-10) -- "Bunny-Wunnies Freak Out" R is free software and comes with ABSOLUTELY NO WARRANTY. R is a collaborative project with many contributors. Type 'demo()' for some demos, 'help()' for on-line help, or [Workspace loaded from C:/Users/olfab/OneDrive/Desktop/MUT_STOCK ASSESSMENT_2020/MUT_ASSESSMENT_2020/MUT_TUN_2020/.RData] Loading required package: FLXSA Restarting R session...
package ‘iterators’ successfully unpacked and MD5 sums checked The downloaded binary packages are in
package ‘FLXSA’ successfully unpacked and MD5 sums checked The downloaded binary packages are in
|
We will need to debug it in your machine, and see where the errror is coming from. If you call
and then
you will be going line by line inside the FLXSA method. Can you keep pressing enter until you get an error message and let me know in what line it stops? |
This bug is due to the negative interaction between FLXSA's C++ code and RStudio and only in Windows we saw in #6. Quick solution is to run the code in plain R. Not sure there will be resources available to fix this, given than XSA has very limited use and it affects a single use case. |
Dear IagoI am returning to you because I had a problem when runing XSA on MUT I get an error after runing this command: aa.stk <- readFLStock("MUT1214_1.ind", no.discards=TRUE)
|
Could you please show what is the error message that readVPA returns? |
Error in readVPA(file, quiet = quiet, sep = sep, na.strings = na.strings) : |
Could you please share the VPA files? Either here or by email |
|
What version of R and FLCore do you have? This works for me here, R 4.12 and FLCore 2.6.18
|
@iagomosqueira |
I have test it with R 4.0.5 and FLCore 2.6.16, the closest I have to your setup, and it works fine. readFLStock has not changed for a long time. Can you call
after the error and post the output? |
aa.stk <- readFLStock("MUT1214_1.ind", no.discards=TRUE)
|
Are you running this in Windows? And from RStudio? |
@iagomosqueira |
@iagomosqueira |
Hi Olfa and Iago, I have done some checking with browser(), because I am having the same issue on my windows machine. So far, I am getting FLXSA to run when I set
So getting closer where to look. |
The test above runs on windows with either diag.flag=TRUE or FALSE with the latest version of FLCore from R-Universe, 2.6.20.9100. Could you confirm @Henning-Winker what version do you have? |
Tried to run FLXSA function but getting error
FLXSA.control.aa <- FLXSA.control(x=NULL, tol=1e-09, maxit=30, min.nse=0.3, fse=0.5, rage=1, qage=3, shk.n=TRUE, shk.f=TRUE, shk.yrs=2, shk.ages=2,window=100, tsrange=20, tspower=3, vpa=FALSE)
Error in h(simpleError(msg, call)) :
error in evaluating the argument 'X' in selecting a method for function 'lapply': negative length vectors are not allowed
The text was updated successfully, but these errors were encountered: