r-spatial / gstat

Spatial and spatio-temporal geostatistical modelling, prediction and simulation
http://r-spatial.github.io/gstat/
GNU General Public License v2.0
195 stars 48 forks source link

package slot missing from signature for generic ‘coerce’ #15

Closed robocop-bob closed 7 years ago

robocop-bob commented 7 years ago
> install.packages("gstat",dependencies=T) 
Installing package into ‘/Users/rob/Library/R/3.3/library’
(as ‘lib’ is unspecified)
also installing the dependency ‘mapdata’

trying URL 'https://cran.rstudio.com/bin/macosx/mavericks/contrib/3.3/mapdata_2.2-6.tgz'
Content type 'application/x-gzip' length 24895619 bytes (23.7 MB)
==================================================
downloaded 23.7 MB

trying URL 'https://cran.rstudio.com/bin/macosx/mavericks/contrib/3.3/gstat_1.1-3.tgz'
Content type 'application/x-gzip' length 2785915 bytes (2.7 MB)
==================================================
downloaded 2.7 MB

The downloaded binary packages are in
    /var/folders/vv/5j3h0wz17z1dg25swdnk23lr0000gn/T//RtmpmRTI68/downloaded_packages
> library(gstat)
Error : package slot missing from signature for generic ‘coerce’
and classes STFDF, RasterBrick
cannot use with duplicate class names (the package may need to be re-installed)
Error: package or namespace load failed for ‘gstat’
> sessionInfo()
R version 3.3.1 (2016-06-21)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.11.6 (El Capitan)

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

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

other attached packages:
 [1] corrplot_0.77        geonames_0.998       rworldxtra_1.01      rworldmap_1.3-6      rgdal_1.1-10         tmap_1.6            
 [7] nominatim_0.2.2.9000 readxl_0.1.1         DT_0.2               googleVis_0.6.1      igraph_1.0.1         networkD3_0.2.13    
[13] htmlwidgets_0.7      sunburstR_0.6.3      fasttime_1.0-1       bit64_0.9-5          bit_1.1-12           markdown_0.7.7      
[19] scales_0.4.0.9003    ggradar_0.1          RColorBrewer_1.1-2   listviewer_1.0       parcoords_0.4.0      rpivotTable_0.1.5.10
[25] formattable_0.2.0.1  pairsD3_0.1.1        timevis_0.4          leaflet_1.0.1        lubridate_1.6.0      dplyr_0.5.0         
[31] ggtech_0.1           ggplot2_2.1.0.9001   flexdashboard_0.3    dygraphs_1.1.1.2     data.table_1.9.7     sp_1.2-3            

loaded via a namespace (and not attached):
 [1] colorspace_1.2-7   deldir_0.1-12      class_7.3-14       rsconnect_0.5      rprojroot_1.0-2    splines_3.3.1     
 [7] arules_1.5-0       extrafont_0.17     knitr_1.14         cartogram_0.0.2    spam_1.4-0         jsonlite_1.1      
[13] Rttf2pt1_1.3.4     rgeos_0.3-20       httr_1.2.1         assertthat_0.1     Matrix_1.2-7.1     lazyeval_0.2.0    
[19] htmltools_0.3.6    tools_3.3.1        coda_0.18-1        gtable_0.2.0       reshape2_1.4.1     maps_3.1.1        
[25] gmodels_2.16.2     Rcpp_0.12.7        raster_2.5-8       spdep_0.6-8        gdata_2.17.0       nlme_3.1-128      
[31] extrafontdb_1.0    stringr_1.1.0      mime_0.5           gtools_3.5.0       devtools_1.12.0    XML_3.98-1.4      
[37] LearnBayes_2.15    MASS_7.3-45        zoo_1.7-13         parallel_3.3.1     fields_8.4-1       yaml_2.1.13       
[43] curl_2.2           memoise_1.0.0      geosphere_1.5-5    pbapply_1.3-0      stringi_1.1.2      maptools_0.8-39   
[49] e1071_1.6-7        boot_1.3-18        intervals_0.15.1   bitops_1.0-6       evaluate_0.10      lattice_0.20-34   
[55] labeling_0.3       osmar_1.1-7        plyr_1.8.4         magrittr_1.5       R6_2.2.0           DBI_0.5-1         
[61] foreign_0.8-67     withr_1.0.2        xts_0.9-7          RCurl_1.95-4.8     tibble_1.2         KernSmooth_2.23-15
[67] rmarkdown_1.1.9006 grid_3.3.1         git2r_0.15.0       digest_0.6.10      classInt_0.1-23    xtable_1.8-2      
[73] httpuv_1.3.3       munsell_0.4.3 
edzer commented 7 years ago

what happens if you remove the package, and reinstall it?

humblerok commented 7 years ago

I had the same experience. Here's how I solved it. After removing packages associated with " sp ", " lattice ", " maps " and " maps ", I installed the " gstat " package by default method(dependency=TRUE) in Rstudio. Finally, It's working now! I hope that you will be resolved.

My session info is

sessionInfo() R version 3.4.2 (2017-09-28) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

locale: [1] LC_COLLATE=Korean_Korea.949 LC_CTYPE=Korean_Korea.949
[3] LC_MONETARY=Korean_Korea.949 LC_NUMERIC=C
[5] LC_TIME=Korean_Korea.949

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

other attached packages: [1] RgoogleMaps_1.4.1 geosphere_1.5-5 sp_1.2-5 NISTunits_1.0.1
[5] extrafont_0.17 ggthemes_3.4.0 ggplot2_2.2.1 devtools_1.13.3
[9] gstat_1.1-5 spacetime_1.2-1

loaded via a namespace (and not attached): [1] Rcpp_0.12.12 compiler_3.4.2 plyr_1.8.4 bitops_1.0-6
[5] xts_0.10-0 tools_3.4.2 digest_0.6.12 memoise_1.1.0
[9] tibble_1.3.4 gtable_0.2.0 lattice_0.20-35 png_0.1-7
[13] rlang_0.1.2 Rttf2pt1_1.3.4 withr_2.0.0 grid_3.4.2
[17] jpeg_0.1-8 extrafontdb_1.0 scales_0.5.0.9000 intervals_0.15.1 [21] assertthat_0.2.0 colorspace_1.3-2 lazyeval_0.2.0 munsell_0.4.3
[25] FNN_1.1 zoo_1.8-0

kamaulindhardt commented 3 years ago

Hi @humblerok ,

What packages did you remove? I have the same problem

> library(gstat)
Error: package or namespace load failed for ‘gstat’:
 package slot missing from signature for generic ‘coerce’
and classes STFDF, RasterBrick
cannot use with duplicate class names (the package may need to be re-installed)
In addition: Warning message:
package ‘gstat’ was built under R version 3.6.2

After reading through this thread I have tried all the suggested fixes, without luck.. Any idea?

> sessionInfo()
R version 3.6.1 (2019-07-05)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: OS X  11.4

Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

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

loaded via a namespace (and not attached):
  [1] GGally_2.1.1              coda_0.19-4              
  [3] intervals_0.15.2          visdat_0.5.3             
  [5] tidyr_1.1.3               ggplot2_3.3.5            
  [7] knitr_1.33                data.table_1.14.0        
  [9] rpart_4.1-15              RCurl_1.98-1.3           
 [11] hardhat_0.1.6             DataExplorer_0.8.2       
 [13] generics_0.1.0            ruler_0.2.4              
 [15] GPfit_1.0-8               callr_3.7.0              
 [17] cowplot_1.1.1             usethis_2.0.1            
 [19] proxy_0.4-26              future_1.21.0            
 [21] correlation_0.6.1         xml2_1.3.2               
 [23] lubridate_1.7.10          spatstat.data_2.1-0      
 [25] httpuv_1.6.1              viridis_0.6.1            
 [27] gower_0.2.2               naniar_0.6.1             
 [29] WRS2_1.1-3                xfun_0.25                
 [31] hms_1.1.0                 evaluate_0.14            
 [33] promises_1.2.0.1          fansi_0.5.0              
 [35] readxl_1.3.1              igraph_1.2.6             
 [37] DBI_1.1.1                 htmlwidgets_1.5.3        
 [39] reshape_0.8.8             spatstat.geom_2.2-2      
 [41] lares_5.0.1               kSamples_1.2-9           
 [43] Rmpfr_0.8-4               paletteer_1.4.0          
 [45] purrr_0.3.4               ellipsis_0.3.2           
 [47] dplyr_1.0.7               ggpubr_0.4.0             
 [49] backports_1.2.1           insight_0.14.1           
 [51] gridBase_0.4-7            deldir_0.2-10            
 [53] vctrs_0.3.8               remotes_2.3.0            
 [55] abind_1.4-5               cachem_1.0.5             
 [57] withr_2.4.2               treemap_2.4-2            
 [59] checkmate_2.0.0           xts_0.12.1               
 [61] prettyunits_1.1.1         parsnip_0.1.7            
 [63] cluster_2.1.0             dotCall64_1.0-1          
 [65] crayon_1.4.1              recipes_0.1.16           
 [67] pkgconfig_2.0.3           SuppDists_1.1-9.5        
 [69] units_0.7-2               nlme_3.1-140             
 [71] vipor_0.4.5               statsExpressions_1.1.0   
 [73] pkgload_1.2.1             nnet_7.3-14              
 [75] devtools_2.4.2            rlang_0.4.11             
 [77] globals_0.14.0            lifecycle_1.0.0          
 [79] MatrixModels_0.4-1        h2o_3.32.0.1             
 [81] circular_0.4-93           cellranger_1.1.0         
 [83] rprojroot_2.0.2           polyclip_1.10-0          
 [85] Matrix_1.2-17             yardstick_0.0.8          
 [87] mc2d_0.1-21               raster_3.4-13            
 [89] carData_3.0-4             boot_1.3-22              
 [91] zoo_1.8-9                 base64enc_0.1-3          
 [93] beeswarm_0.4.0            corrr_0.4.3              
 [95] ggridges_0.5.3            processx_3.5.2           
 [97] png_0.1-7                 viridisLite_0.4.0        
 [99] PMCMRplus_1.9.0           bitops_1.0-7             
[101] ERAg_0.0.1.0000           parameters_0.14.0        
[103] KernSmooth_2.23-15        spam_2.6-0               
[105] pROC_1.17.0.1             spatialsample_0.1.0      
[107] tune_0.1.6                classInt_0.4-3           
[109] workflows_0.2.3           stringr_1.4.0            
[111] multcompView_0.1-8        maptools_1.1-1           
[113] parallelly_1.27.0         jpeg_0.1-9               
[115] rstatix_0.7.0             ggsignif_0.6.0           
[117] scales_1.1.1              memoise_2.0.0            
[119] magrittr_2.0.1            plyr_1.8.6               
[121] compiler_3.6.1            RColorBrewer_1.1-2       
[123] lme4_1.1-27.1             see_0.6.4                
[125] cli_3.0.1                 lmerTest_3.1-3           
[127] threadr_0.9.126           DiceDesign_1.9           
[129] listenv_0.8.0             patchwork_1.1.1          
[131] pbapply_1.4-3             ps_1.6.0                 
[133] htmlTable_2.2.1           Formula_1.2-4            
[135] MASS_7.3-53               mgcv_1.8-33              
[137] tidyselect_1.1.1          stringi_1.7.3            
[139] forcats_0.5.1             butcher_0.1.5            
[141] yaml_2.2.1                latticeExtra_0.6-29      
[143] ggrepel_0.9.1             hablar_0.3.0             
[145] grid_3.6.1                tools_3.6.1              
[147] parallel_3.6.1            rio_0.5.16               
[149] rstudioapi_0.13           foreach_1.5.1            
[151] foreign_0.8-71            gridExtra_2.3            
[153] ipmisc_6.0.2              prodlim_2019.11.13       
[155] pairwiseComparisons_3.1.6 keyholder_0.1.5          
[157] digest_0.6.27             lava_1.6.9               
[159] shiny_1.6.0               networkD3_0.4            
[161] BWStest_0.2.2             Rcpp_1.0.7               
[163] car_3.0-10                broom_0.7.9              
[165] BayesFactor_0.9.12-4.2    performance_0.7.2        
[167] later_1.2.0               httr_1.4.2               
[169] sf_1.0-2                  effectsize_0.4.5         
[171] colorspace_2.0-2          rvest_1.0.0              
[173] fs_1.5.0                  splines_3.6.1            
[175] fields_12.5               rematch2_2.1.2           
[177] spatstat.utils_2.2-0      sp_1.4-5                 
[179] sessioninfo_1.1.1         xtable_1.8-4             
[181] gmp_0.6-2                 jsonlite_1.7.2           
[183] nloptr_1.2.2.2            timeDate_3043.102        
[185] zeallot_0.1.0             ipred_0.9-11             
[187] testthat_3.0.4            R6_2.5.0                 
[189] Hmisc_4.5-0               lhs_1.1.1                
[191] pillar_1.6.2              htmltools_0.5.1.1        
[193] mime_0.11                 glue_1.4.2               
[195] fastmap_1.1.0             minqa_1.2.4              
[197] class_7.3-15              codetools_0.2-16         
[199] rworldmap_1.3-6           maps_3.3.0               
[201] pkgbuild_1.2.0            mvtnorm_1.1-2            
[203] furrr_0.2.3               utf8_1.2.2               
[205] lattice_0.20-44           tibble_3.1.3             
[207] dials_0.0.9               numDeriv_2016.8-1.1      
[209] curl_4.3.2                ggbeeswarm_0.6.0         
[211] gtools_3.9.2              zip_2.2.0                
[213] openxlsx_4.1.5            survival_3.2-11          
[215] rmarkdown_2.9             desc_1.3.0               
[217] munsell_0.5.0             e1071_1.7-8              
[219] stacks_0.2.0              rsample_0.1.0            
[221] iterators_1.0.13          diagis_0.1.5             
[223] ggstatsplot_0.8.0         haven_2.3.1              
[225] gtable_0.3.0              bayestestR_0.10.0    
edzer commented 3 years ago

update R.

silambu92 commented 2 years ago

i have the following error after installing microbiomSeq package pls. help me to solve this issue

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

abroryp2 commented 2 years ago

Hello, I also have the same problem like silambu92. Any idea how to solve this? Sorry, I am new comer here. Thanks

edzer commented 2 years ago

That message has nothing to do with gstat. Maybe reinstall raster and terra, then gstat?

zhaojin120 commented 2 years ago

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)

My R viersion is 4.1.2 .I updated my R ,but I have a same question. Thank you very much. I am a new student.

edzer commented 2 years ago

As I said before, it is not clear why or how that error has to do something with gstat.

zhaojin120 commented 2 years ago

Thank you for your reply. I have given up the installation of this package or wait for other people's research

asadstat commented 8 months ago

library(gstat) Error: package or namespace load failed for ‘gstat’: package slot missing from signature for generic ‘coerce’ and classes STFDF, RasterBrick cannot use with duplicate class names (the package may need to be re-installed) In addition: Warning message: package ‘gstat’ was built under R version 3.6.2

I have also face the same problem. i solve it after uninstall packages "gstat" and then i again install "gstat" using dependency=TRUE and it work fine. just follow the step step1: remove.packages("gstat") step2:install.packages("gstat",dependency=TRUE)

edzer commented 8 months ago

What is your sessionInfo()?

asadstat commented 8 months ago

What is your sessionInfo()?

Session info setting value version R version 4.3.1 (2023-06-16 ucrt) os Windows 10 x64 (build 19045) system x86_64, mingw32 ui RStudio language (EN) collate English_United States.utf8 ctype English_United States.utf8 tz Asia/Dhaka date 2024-01-30 rstudio 2023.12.0+369 Ocean Storm (desktop) pandoc NA