Skip to content

unionSpatialPolygons from the command-line

3 messages · Stachelek, Joseph, Roger Bivand, Edzer Pebesma

#
Hello,

I am trying to call "maptools::unionSpatialPolygons()" from the command-line. To illustrate the problem, I can call example(unionSpatialPolygons) from an interactive session but running an R script (testmaptools.R) containing:

`library(maptools)`
`example(unionSpatialPolygons)`

yields:

`$ Rscript testmaptools.R`
Is this not possible?

Thank you,

Joseph Stachelek


We value your opinion. Please take a few minutes to shar...{{dropped:8}}
#
On Thu, 7 Apr 2016, Stachelek, Joseph wrote:

            
With R --vanilla < testmaptools.R

and adding print(sessionInfo()) to the script, we see:

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

and it runs correctly. With

Rscript testmaptools.R

we see:

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

The script runs using Rscript if library(methods) is added as the first 
line. This issue has been seen elsewhere recently in another context, we 
don't know why.

Hope this clarifies,

Roger

  
    
#
For package sp, I moved "methods" from Imports: to Depends: in order to
avoid this problem with future sp versions or packages with sp in Depends:
On 08/04/16 13:15, Roger Bivand wrote: