[R] [FORGED] [bug] spdep package?

Jeremie Juste jerem|eju@te @end|ng |rom gm@||@com
Mon Jul 23 15:44:53 CEST 2018


Hello,


>This is *very* unlikely to be a bug.  People should always exercise a
>great deal of caution about conjecturing bugs when they encounter a
>phenomenon that they don't understand.

Ok,  I over reacted and I should let the package maintainers
qualify what is a bug or not. My point is that it is surprising to have
access these variables in the global environment when loading the spdep
library.

I normally I would expect the following

 rm(list=ls())
 myfun <- function(x){
        y+ 33}
        
> myfun(x)
> Error in myfun(4) : object 'y' not found

But this is not cool 
> myfun()
 [1]  33  63  93 123 153 183 213 243 273 303 333 363 393 423 453 483


> It puzzles me that your sessionInfo() doesn't show something like:
You are right. My apologies. I confused sessions when I pasted the
sessionInfo.  Allow me to correct.



<on the Terminal> R --vanilla -q 
> ls()
character(0)
> library(spdep)
Loading required package: sp
Loading required package: Matrix
Loading required package: spData
To access larger datasets in this package, install the spDataLarge
package with: `install.packages('spDataLarge')`
> ls()
character(0)
> sessionInfo()
R version 3.4.1 (2017-06-30)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Debian GNU/Linux 9 (stretch)

Matrix products: default
BLAS: /usr/local/lib/R/lib/libRblas.so
LAPACK: /usr/local/lib/R/lib/libRlapack.so

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

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

other attached packages:
[1] spdep_0.7-7    spData_0.2.6.7 Matrix_1.2-10  sp_1.2-5      

loaded via a namespace (and not attached):
 [1] lattice_0.20-35     deldir_0.1-14       gtools_3.5.0       
 [4] MASS_7.3-47         grid_3.4.1          nlme_3.1-131       
 [7] coda_0.19-1         data.table_1.10.4-3 gdata_2.18.0       
[10] LearnBayes_2.15     gmodels_2.16.2      boot_1.3-19        
[13] splines_3.4.1       compiler_3.4.1      filehash_2.4-1     
[16] expm_0.999-2       
> x
 [1]   0  30  60  90 120 150 180 210 240 270 300 330 360 390 420 450


I think Henrik Bengtsson has identified the issue see the next thread. 

Best regards,

Jeremie




More information about the R-help mailing list