[R-sig-Geo] Even simpler TM_WORLD_BORDERS_SIMPLE (AND SP???)

Hans-Jörg Bibiko bibiko at eva.mpg.de
Fri Jan 30 08:45:28 CET 2009


On 30.01.2009, at 07:47, Edzer Pebesma wrote:

> Jim Burke wrote:
>> OK I am on decaf coffee now. I reinstalled R and
>> all is well now.
>>
>> Now Hans, below is what I get when I run your code.
>> Is this expected? Quick and certainly DIRTY.
>>
>> > library("maptools")
>> Loading required package: foreign
>> > load(url("http://spatial.nhh.no/R/etc/TM_WORLD_BORDERS_SIMPL-0.2.RData 
>> "))
>> > wrld_simpl <- wrld_simpl[wrld_simpl$NAME != "Antarctica",]
>> Warning message:
>> closing unused connection 3 (gzcon(http://spatial.nhh.no/R/etc/TM_WORLD_BORDERS_SIMPL-0.2.RData) 
>> )
>> > for (i in (1:length(wrld_simpl at polygons))) {
>> + polyCnt <- length(wrld_simpl at polygons[[i]]@Polygons)
>> + if(polyCnt > 2) {
>> + pO <- sapply(wrld_simpl at polygons[[i]]@Polygons, function(x)  
>> {slot(x,'area')>0.1})
>> + new_pO <- pO[ wrld_simpl at polygons[[i]]@plotOrder ]
>> + wrld_simpl at polygons[[i]]@plotOrder <-  
>> wrld_simpl at polygons[[i]]@plotOrder[ new_pO ]
>> + }
>> + }
>> > save(wrld_simpl,'SIMPLEMAP.Rdata')
>> Error in save(wrld_simpl, "SIMPLEMAP.Rdata") :
>> object ‘SIMPLEMAP.Rdata’ not found
> How about taking a look at the help pages of the save command?

Jim, did you look at the help page?

I simply forgot to name an argument:

save(wrld_simpl,file='SIMPLEMAP.Rdata')

--Hans




More information about the R-sig-Geo mailing list