Dear list members,



I want to use some spatstat facilities for handling my geological faults
shapefile data.


First step I read my data into spatstat

(Thanks for the vignette of Adrian Baddeley “Handling shapefiles in the
spatsat”
http://cran.r-project.org/web/packages/spatstat/vignettes/shapefiles.pdf ).


Then I convert them either into a single object of class “psp” or into a
list of object of class “psp”.

But after those transformations, I still cannot use the facilities of
spatstat for handling my fracture line segment list of class “psp”.

For example by using angles.psp or crossing.psp facilities I keep receiving
the error message = Error in verifyclass(x, "psp") : argument 'x' is not of
class 'psp'. What am I doing wrong!!!

I'd welcome any hints on this question. Does anyone have experience with
this or possibly an idea on how I might solve the issue?
Below some commands and results used so far.


 Sincerely



x<-readShapeSpatial("fractureshp.shp")

> class(x)

[1] "SpatialLinesDataFrame"

attr(,"package")

[1] "sp"

> as.psp(x) ###store the fractures as a single object of class psp

planar line segment pattern: 6 line segments

window: rectangle = [234027.52, 235479.43] x [1700993, 1702270.7] units

Marks vector of type 'integer'

plot(x) # #### plot of the fractures =>>ok

lengths.psp(x) #####   Error in verifyclass(x, "psp") : argument 'x' is not
of class 'psp'



#######To convert the SpatialLinesDataFrame to psp:

ydata<-slot(x,"data")

yl<-as(x,"SpatialLines")

ycurves<-slot(yl,"lines")

ycurves<-lapply(ycurves,function(x){SpatialLines(list(x))} )

ypatterns<-lapply(ycurves,as.psp)

> class(ypatterns)

[1] "list"

> summary(ypatterns)

     Length Class Mode

[1,] 4      psp   list

[2,] 4      psp   list

[3,] 4      psp   list

[4,] 4      psp   list

[5,] 4      psp   list

[6,] 4      psp   list

lengths.psp(ypatterns) #####   Error in verifyclass(x, "psp") : argument 'x'
is not of class 'psp'

-- 
Mit freundlichen Grüßen / Kind regards / Meilleures Salutations


Eric Böker

Hydrogéologue
Chef Projet PMRE
Hippodrome
Rue 326, Porte 21
BP 701 BAMAKO (MALI)
Cell: (00223) 766 87 477
e-mail: eric.boeker@gmail.com

	[[alternative HTML version deleted]]

