tokami / TropFishR

Tropical Fisheries Analysis with R
24 stars 19 forks source link

Error in ELEFAN_SA #49

Closed jethroppaPH closed 8 months ago

jethroppaPH commented 8 months ago

I am running the ELEFAN_SA() function. Here's the code:

sp_SA <- ELEFAN_SA(
  lfq = sp_rlfd,
  seasonalised = TRUE,
  init_par = list(
    Linf = Linf03,
    K = 1,
    t_anchor = 0.5,
    ts = 0.5,
    C = 0.5
  ),
  low_par = list(
    Linf = Linf03 - 2,
    K = 0.5,
    t_anchor = 0, ts = 0, C = 0
  ),
  up_par = list(
    Linf = Linf03 + 2,
    K = 1.5,
    t_anchor = 1, ts = 1, C = 1
  ),
  SA_temp = 2e5,
  SA_time = 60 * 5,
  maxit = 500,
  MA = 5,
  plot.score = TRUE,
  verbose = FALSE
)

However, I got this error:

Simulated annealing is running. 
This will take approximately 1 minutes.
value: 39
Error in aggregate.data.frame(as.data.frame(x), ...) : 
  no rows to aggregate

P.S. The code above works fine while I am on Arch Linux. Currently, I migrated to Debian 12.

Currently using TropFishR version 1.6.2 (I tried using 1.6.3 but I encountered similar error).

Edit 1: I also tried the 1.6.0 version ("nojags"), but same error. Edit 2: Same issue when I tried to run it in a virtual machine running Linux Mint and Manjaro. Edit 3: By the way, here's the data I used: data

Here's the sessionInfo()

R version 4.3.2 (2023-10-31)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Debian GNU/Linux 12 (bookworm)

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.21.so;  LAPACK version 3.11.0

locale:
 [1] LC_CTYPE=en_PH.UTF-8       LC_NUMERIC=C               LC_TIME=en_PH.UTF-8        LC_COLLATE=en_PH.UTF-8    
 [5] LC_MONETARY=en_PH.UTF-8    LC_MESSAGES=en_PH.UTF-8    LC_PAPER=en_PH.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_PH.UTF-8 LC_IDENTIFICATION=C       

time zone: Asia/Manila
tzcode source: system (glibc)

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] TropFishR_1.6.2    RColorBrewer_1.1-3 data.table_1.14.10 here_1.0.1        

loaded via a namespace (and not attached):
 [1] crayon_1.5.2      doParallel_1.0.17 cli_3.6.2         zoo_1.8-12        bit_4.0.5         msm_1.7.1         tmvtnorm_1.6     
 [8] gmm_1.8           rprojroot_2.0.4   ff_4.0.9          stats4_4.3.2      grid_4.3.2        expm_0.999-8      MASS_7.3-60      
[15] foreach_1.5.2     mvtnorm_1.2-4     propagate_1.0-6   compiler_4.3.2    codetools_0.2-19  sandwich_3.1-0    Rcpp_1.0.11      
[22] GenSA_1.1.12      lattice_0.22-5    parallel_4.3.2    splines_4.3.2     minpack.lm_1.2-4  Matrix_1.6-1.1    tools_4.3.2      
[29] iterators_1.0.14  GA_3.2.3          survival_3.5-7   
jethroppaPH commented 8 months ago

I've already found a solution. I set up the GenSA package in its 1.1.7 version. I'm going to close this issue.

wietteguh89 commented 8 months ago

Hello I also have a problem like yours. Could you share how you change the GenSA version?

jethroppaPH commented 8 months ago

@wietteguh89 I installed it using remotes::install_version("GenSA", "1.1.7").

wietteguh89 commented 8 months ago

Thank you so much I will try