I am having a hard time understanding where this error comes from. When running
Index = SpatialDeltaGLMM::PlotIndex_Fn(DirName=this.path, TmbData=TmbData, Sdreport=Opt[["SD"]], Year_Set=Year$Year, Years2Include=Years2Include, use_biascorr=TRUE )
SpatialDeltaGLMM::Plot_range_shifts(Report=Report, TmbData=TmbData, Sdreport=Opt[["SD"]], Znames=colnames(TmbData$Z_xm), PlotDir=this.path, Year_Set=Year_Set)
I get
Error in plot.window(...) : need finite 'ylim' values
In addition to a warning
Below is structure of the TmbData , followed by session info
str(TmbData)
List of 35
$ n_i : int 221
$ n_s : int 237
$ n_x : int 221
$ n_t : num 12
$ n_c : num 1
$ n_j : int 1
$ n_p : int 1
$ n_k : int 1
$ n_v : num 1
$ n_l : int 1
$ n_m : int 2
$ Options_vec : Named num [1:8] 1 0 0 0 0 200 1 0
..- attr(, "names")= chr [1:8] "Aniso" "R2_interpretation" "Rho_betaTF" "Alpha" ...
$ FieldConfig : Named num [1:4] 1 1 1 1
..- attr(, "names")= chr [1:4] "Omega1" "Epsilon1" "Omega2" "Epsilon2"
$ OverdispersionConfig: Named num [1:2] -1 -1
..- attr(, "names")= chr [1:2] "Vessel" "VesselYear"
$ ObsModel : num [1:2] 2 3
$ Options : Named num [1:9] 0 0 1 0 1 0 0 0 0
..- attr(, "names")= chr [1:9] "SD_site_density" "SD_site_logdensity" "Calculate_Range" "Calculate_evenness" ...
$ yearbounds_zz : num [1, 1:2] 0 11
$ b_i : num [1:221] 8.33 23.48 21.17 12 0 ...
$ a_i : num [1:221] 1 1 1 1 1 1 1 1 1 1 ...
$ c_i : num [1:221] 0 0 0 0 0 0 0 0 0 0 ...
$ s_i : num [1:221] 0 1 2 3 4 5 6 7 8 9 ...
$ t_iz : int [1:221, 1] 0 0 0 0 0 0 0 0 1 1 ...
$ v_i : num [1:221] 0 0 0 0 0 0 0 0 0 0 ...
$ PredTF_i : num [1:221] 0 0 0 0 0 0 0 0 0 0 ...
$ a_xl : num [1:221, 1] 52 40 20 4 36 4 36 28 4 16 ...
..- attr(, "dimnames")=List of 2
.. ..$ : NULL
.. ..$ : chr "All_areas"
$ X_xj : num [1:221, 1] 0 0 0 0 0 0 0 0 0 0 ...
$ X_xtp : num [1:221, 1:12, 1] 0 0 0 0 0 0 0 0 0 0 ...
$ Q_ik : num [1:221, 1] 0 0 0 0 0 0 0 0 0 0 ...
$ t_yz : int [1:12, 1] 0 1 2 3 4 5 6 7 8 9 ...
$ Z_xm : num [1:221, 1:2] 524 525 530 537 539 ...
..- attr(, "dimnames")=List of 2
.. ..$ : NULL
.. ..$ : chr [1:2] "E_km" "N_km"
$ spde :List of 3
..$ M0:Formal class 'dgTMatrix' [package "Matrix"] with 6 slots
.. .. ..@ i : int [1:237] 0 1 2 3 4 5 6 7 8 9 ...
.. .. ..@ j : int [1:237] 0 1 2 3 4 5 6 7 8 9 ...
.. .. ..@ Dim : int [1:2] 237 237
.. .. ..@ Dimnames:List of 2
.. .. .. ..$ : NULL
.. .. .. ..$ : NULL
.. .. ..@ x : num [1:237] 88.34 111.16 59.16 3.11 115.34 ...
.. .. ..@ factors : list()
..$ M1:Formal class 'dgTMatrix' [package "Matrix"] with 6 slots
.. .. ..@ i : int [1:1621] 0 1 18 74 86 105 106 0 1 72 ...
.. .. ..@ j : int [1:1621] 0 0 0 0 0 0 0 1 1 1 ...
.. .. ..@ Dim : int [1:2] 237 237
.. .. ..@ Dimnames:List of 2
.. .. .. ..$ : NULL
.. .. .. ..$ : NULL
.. .. ..@ x : num [1:1621] 12.873 -3.225 -0.625 -0.833 -6.723 ...
.. .. ..@ factors : list()
..$ M2:Formal class 'dgTMatrix' [package "Matrix"] with 6 slots
.. .. ..@ i : int [1:4981] 0 1 18 39 52 53 72 73 74 85 ...
.. .. ..@ j : int [1:4981] 0 0 0 0 0 0 0 0 0 0 ...
.. .. ..@ Dim : int [1:2] 237 237
.. .. ..@ Dimnames:List of 2
.. .. .. ..$ : NULL
.. .. .. ..$ : NULL
.. .. ..@ x : num [1:4981] 3.61 1.54 -1.12 1.69e+01 2.84e-07 ...
.. .. ..@ factors : list()
$ spde_aniso :List of 9
..$ n_s : int 237
..$ n_tri : int 456
..$ Tri_Area: num [1:456] 18.19 211.96 1.46 15.03 18.78 ...
..$ E0 : num [1:456, 1:2] -8.222 30.891 -0.664 11.242 -4.54 ...
..$ E1 : num [1:456, 1:2] 3.78 -27.21 0.54 -11.76 -2.48 ...
..$ E2 : num [1:456, 1:2] 4.446 -3.682 0.124 0.521 7.016 ...
..$ TV : num [1:456, 1:3] 30 7 68 85 52 46 231 44 90 39 ...
..$ G0 :Formal class 'dgTMatrix' [package "Matrix"] with 6 slots
.. .. ..@ i : int [1:237] 0 1 2 3 4 5 6 7 8 9 ...
.. .. ..@ j : int [1:237] 0 1 2 3 4 5 6 7 8 9 ...
.. .. ..@ Dim : int [1:2] 237 237
.. .. ..@ Dimnames:List of 2
.. .. .. ..$ : NULL
.. .. .. ..$ : NULL
.. .. ..@ x : num [1:237] 88.34 111.16 59.16 3.11 115.34 ...
.. .. ..@ factors : list()
..$ G0_inv :Formal class 'dgTMatrix' [package "Matrix"] with 6 slots
.. .. ..@ i : int [1:237] 0 1 2 3 4 5 6 7 8 9 ...
.. .. ..@ j : int [1:237] 0 1 2 3 4 5 6 7 8 9 ...
.. .. ..@ Dim : int [1:2] 237 237
.. .. ..@ Dimnames:List of 2
.. .. .. ..$ : NULL
.. .. .. ..$ : NULL
.. .. ..@ x : num [1:237] 0.01132 0.009 0.0169 0.32144 0.00867 ...
.. .. ..@ factors : list()
$ M0 :Formal class 'dgTMatrix' [package "Matrix"] with 6 slots
.. ..@ i : int [1:491] 0 1 2 3 4 5 6 7 8 9 ...
.. ..@ j : int [1:491] 0 1 2 3 4 5 6 7 8 9 ...
.. ..@ Dim : int [1:2] 491 491
.. ..@ Dimnames:List of 2
.. .. ..$ : NULL
.. .. ..$ : NULL
.. ..@ x : num [1:491] 1 1 1 1 1 1 1 1 1 1 ...
.. ..@ factors : list()
$ M1 :Formal class 'dgTMatrix' [package "Matrix"] with 6 slots
.. ..@ i : int [1:1604] 1 4 0 5 3 6 2 7 0 5 ...
.. ..@ j : int [1:1604] 0 0 1 1 2 2 3 3 4 4 ...
.. ..@ Dim : int [1:2] 491 491
.. ..@ Dimnames:List of 2
.. .. ..$ : NULL
.. .. ..$ : NULL
.. ..@ x : num [1:1604] 1 1 1 1 1 1 1 1 1 1 ...
.. ..@ factors : list()
$ M2 :Formal class 'dgTMatrix' [package "Matrix"] with 6 slots
.. ..@ i : int [1:1480] 5 4 7 6 1 8 10 0 9 11 ...
.. ..@ j : int [1:1480] 0 1 2 3 4 4 4 5 5 5 ...
.. ..@ Dim : int [1:2] 491 491
.. ..@ Dimnames:List of 2
.. .. ..$ : NULL
.. .. ..$ : NULL
.. ..@ x : num [1:1480] 1 1 1 1 1 1 1 1 1 1 ...
.. ..@ factors : list()
sessionInfo()
R version 3.4.0 (2017-04-21)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 16.04.3 LTS
Matrix products: default
BLAS: /usr/lib/libblas/libblas.so.3.6.0
LAPACK: /usr/lib/lapack/liblapack.so.3.6.0
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8
[4] LC_COLLATE=en_US.UTF-8 LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C LC_ADDRESS=C
[10] LC_TELEPHONE=C LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] parallel stats graphics grDevices utils datasets methods base
other attached packages:
[1] broom_0.4.2 bindrcpp_0.2 pander_0.6.1 doSNOW_1.0.14
[5] snow_0.4-2 iterators_1.0.8 foreach_1.4.3 ThorsonUtilities_1.0
[9] TMB_1.7.11 VAST_1.5.0 SpatialDeltaGLMM_3.4.0 rmarkdown_1.6.0.9009
[13] orthopolynom_1.0-5 polynom_1.3-9 splancs_2.01-40 arm_1.9-3
[17] lme4_1.1-14 Matrix_1.2-10 MASS_7.3-47 rgdal_1.2-15
[21] PBSmapping_2.70.4 maptools_0.9-2 sp_1.2-5 reshape_0.8.7
[25] stringr_1.2.0 dplyr_0.7.4 purrr_0.2.4 readr_1.1.1
[29] tidyr_0.7.2 tibble_1.3.4 tidyverse_1.1.1 scales_0.5.0.9000
[33] devtools_1.13.3 RColorBrewer_1.1-2 ggmap_2.6.1 ggplot2_2.2.1.9000
[37] ggthemes_3.4.0 magrittr_1.5 data.table_1.10.4
loaded via a namespace (and not attached):
[1] nlme_3.1-131 lubridate_1.6.0 httr_1.3.1 rprojroot_1.2 tools_3.4.0
[6] backports_1.1.0 R6_2.2.2.9000 lazyeval_0.2.0 colorspace_1.3-2 withr_2.1.0
[11] tidyselect_0.2.2 mnormt_1.5-5 compiler_3.4.0 rvest_0.3.2 xml2_1.1.1
[16] labeling_0.3 psych_1.7.5 digest_0.6.12 foreign_0.8-67 minqa_1.2.4
[21] jpeg_0.1-8 pkgconfig_2.0.1 htmltools_0.3.6 maps_3.2.0 rlang_0.1.2
[26] readxl_1.0.0 shape_1.4.3 bindr_0.1 jsonlite_1.5 TMBhelper_1.0
[31] geosphere_1.5-5 Rcpp_0.12.13 munsell_0.4.3 abind_1.4-5 proto_1.0.0
[36] stringi_1.1.5 plyr_1.8.4 grid_3.4.0 forcats_0.2.0 lattice_0.20-35
[41] INLA_17.06.20 haven_1.0.0 splines_3.4.0 mapproj_1.2-5 hms_0.3
[46] knitr_1.17 rjson_0.2.15 reshape2_1.4.2 codetools_0.2-15 glue_1.2.0
[51] evaluate_0.10.1 mapdata_2.2-6 modelr_0.1.0 png_0.1-7 nloptr_1.0.4
[56] RgoogleMaps_1.4.1 cellranger_1.1.0 RANN_2.5.1 gtable_0.2.0 assertthat_0.2.0
[61] coda_0.19-1 memoise_1.1.0