jeffreyevans/spatialEco

No raster.modifed.ttest function

estebangatillo opened this issue · 2 comments

First of all, thank you for your work. I've seen your name a ton on SE and appreciate your input.

I've used the spatialEco package before. I'm surprised this isn't working. It just says: Error in raster.modifed.ttest(G1, G2) : could not find function "raster.modifed.ttest"

I've tried on two machines, windows and linux. Maybe there is a dependency I'm unaware of or an update I'm missing? Or maybe I'm just making a silly error somewhere. Here is my output from your example code:

 library(gstat)                                         
Warning message:
package ‘gstat’ was built under R version 4.1.2 
> library(sp)
> library(raster)
> library(spatialEco)                                            

Attaching package: ‘spatialEco’

The following object is masked from ‘package:raster’:

    shift

> data(meuse)                                            
> View(meuse)
> data(meuse.grid)                                       
> View(meuse.grid)
> coordinates(meuse) <- ~x + y                           
> coordinates(meuse.grid) <- ~x + y 
> # GRID-1 log(copper):                                              
> v1 <- variogram(log(copper) ~ 1, meuse)                  
> x1 <- fit.variogram(v1, vgm(1, "Sph", 800, 1))           
> G1 <- krige(zinc ~ 1, meuse, meuse.grid, x1, nmax = 30)
[using ordinary kriging]
> gridded(G1) <- TRUE                                      
> G1@data = as.data.frame(G1@data[,-2])
> # GRID-2 log(elev):                                              
> v2 <- variogram(log(elev) ~ 1, meuse)                  
> x2 <- fit.variogram(v2, vgm(.1, "Sph", 1000, .6))        
> G2 <- krige(elev ~ 1, meuse, meuse.grid, x2, nmax = 30)
[using ordinary kriging]
> gridded(G2) <- TRUE    
> G2@data <- as.data.frame(G2@data[,-2])
> G2@data[,1] <- G2@data[,1]
> corr <- raster.modifed.ttest(G1, G2)      
Error in raster.modifed.ttest(G1, G2) : 
  could not find function "raster.modifed.ttest"
> 

Here is the package version installed:

packageVersion("spatialEco")
[1] ‘1.3.7’

Here is session info for the linux system I used in checking this issue if this helps:

sessionInfo()
R version 3.6.3 (2020-02-29)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.5 LTS

Thanks again for your presence in the FOSS community and thank you in advance for your insights into this issue. If you need any further info I'm happy to provide.

Ah, Gracias! I bet if I slept for three more hours last night I could have caught that without posting this inquiry :)