Package or namespace load error in R
0
0
Entering edit mode
2.3 years ago
MSRS ▴ 580

Hi, I am trying to install the package adespatial, but the error is the like below. Any suggestions, please.

> library(adespatial)
Error: package or namespace load failed for ‘adespatial’:
 package slot missing from signature for generic ‘coerce’
and classes Raster, SpatRaster
cannot use with duplicate class names (the package may need to be re-installed)

Same for other packages too!

> library(microbiomeSeq)  #load the package
Error: package or namespace load failed for ‘microbiomeSeq’:
 package slot missing from signature for generic ‘coerce’
and classes Raster, SpatRaster
cannot use with duplicate class names (the package may need to be re-installed)

I am using R version 4.1.2 and RStudio 2021.9

R • 3.1k views
ADD COMMENT
2
Entering edit mode

Do what it says. Reinstall.

ADD REPLY
0
Entering edit mode

I have the same problem. I have reinstalled several times. The error persists.

ADD REPLY
0
Entering edit mode

Did you reinstall microbiomeSeq? If so and the error presists consider opening an issue at https://github.com/umerijaz/microbiomeSeq, including full commands and the sessionInfo().

ADD REPLY
0
Entering edit mode

It happens to me too but with other packages: automap and blockCV (one or the other depending on the order of loading in RStudio). In my case, the problem seems to be associated with classes STFDF and RasterBrick. I have tried many solutions but with no success: upgrading R and RStudio, updating packages, uninstalling and reinstalling,... Surprisingly, the only temporary solution I found was to load those libraries directly with R (problem persists with RStudio). I don't know why but it worked for me. However, I am still trying to figure out how to solve it properly. I am also using R version 4.1.2 and RStudio 2021.09.2. Any suggestion would be really appreciated.

sessionInfo() R version 4.1.2 (2021-11-01) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 10 x64 (build 19043)

Matrix products: default

locale: [1] LC_COLLATE=Spanish_Spain.1252 LC_CTYPE=Spanish_Spain.1252 LC_MONETARY=Spanish_Spain.1252 [4] LC_NUMERIC=C LC_TIME=Spanish_Spain.1252
system code page: 65001

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

other attached packages: [1] raster_3.5-15 sp_1.4-6 terra_1.5-17 blockCV_2.1.4

loaded via a namespace (and not attached): [1] sf_1.0-5 xts_0.12.1 RColorBrewer_1.1-2 progress_1.2.2 tools_4.1.2
[6] backports_1.4.1 utf8_1.2.2 R6_2.5.1 rpart_4.1.16 KernSmooth_2.23-20 [11] Hmisc_4.6-0 DBI_1.1.2 colorspace_2.0-2 nnet_7.3-17 tidyselect_1.1.1
[16] gridExtra_2.3 prettyunits_1.1.1 compiler_4.1.2 cli_3.1.1 htmlTable_2.4.0
[21] sandwich_3.0-1 scales_1.1.1 checkmate_2.0.0 lmtest_0.9-39 classInt_0.4-3
[26] mvtnorm_1.1-3 proxy_0.4-26 stringr_1.4.0 digest_0.6.29 foreign_0.8-82
[31] base64enc_0.1-3 jpeg_0.1-9 pkgconfig_2.0.3 htmltools_0.5.2 fastmap_1.1.0
[36] htmlwidgets_1.5.4 rlang_1.0.0 rstudioapi_0.13 shiny_1.7.1 generics_0.1.2
[41] zoo_1.8-9 dplyr_1.0.7 magrittr_2.0.2 Formula_1.2-4 leaps_3.1
[46] Matrix_1.4-0 Rcpp_1.0.8 munsell_0.5.0 fansi_1.0.2 abind_1.4-5
[51] lifecycle_1.0.1 stringi_1.7.6 multcomp_1.4-18 MASS_7.3-55 plyr_1.8.6
[56] grid_4.1.2 promises_1.2.0.1 crayon_1.4.2 lattice_0.20-45 HH_3.1-47
[61] splines_4.1.2 hms_1.1.1 knitr_1.37 pillar_1.7.0 reshape2_1.4.4
[66] codetools_0.2-18 glue_1.6.1 latticeExtra_0.6-29 data.table_1.14.2 vcd_1.4-9
[71] png_0.1-7 vctrs_0.3.8 httpuv_1.6.5 gtable_0.3.0 purrr_0.3.4
[76] ggplot2_3.3.5 xfun_0.29 mime_0.12 xtable_1.8-4 Rmpfr_0.8-7
[81] e1071_1.7-9 later_1.3.0 class_7.3-20 survival_3.2-13 tibble_3.1.6
[86] intervals_0.15.2 units_0.7-2 cluster_2.1.2 gmp_0.6-2.1 TH.data_1.1-0
[91] ellipsis_0.3.2

ADD REPLY
0
Entering edit mode

Package raster produces the same problem (same message) after loading automap. BlockCV and raster packages can be loaded in the same session without problem. So it looks like an incompatibility problem between automap and the other two in my case... but only when using RStudio (very strange for me).

ADD REPLY

Login before adding your answer.

Traffic: 2507 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6