Roger Bivand wrote:
> On Mon, 25 Jun 2007, Agustin Lobo wrote:
>
>> I've tried (among other things):
>>>  limit1 <- read.shape("limit_PNSN2000.shp")
>> Shapefile type: Polygon, (5), # of Shapes: 2
>>>  limit1poly <- Map2poly(limit1)
>>>  limit1owin <- as(limit1poly,"owin")
>> Error in .classEnv(thisClass) : unable to find an environment 
>> containing class "polylist"
>>
>>>  limit2 <- readOGR("limit_PNSN2000.shp",layer="limit_PNSN2000")
>> OGR data source with driver: ESRI Shapefile
>> Source: "limit_PNSN2000.shp", layer: "limit_PNSN2000"
>> with  2  rows and  1  columns
>
> Then just:
>
> limit1owin <- as(limit2,"owin")
>
> ought to work with current maptools, or possibly coerce:
>
> limit1owin <- as(as(limit2, "SpatialPolygons"), "owin")
>
the latter form shouldn't be needed thanks to S4 inheritance.
--
Edzer

_______________________________________________
R-sig-Geo mailing list
R-sig-Geo@stat.math.ethz.ch
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Reply via email to