Re: [R] any good way to convert sp class objects to splancs object

2006-10-25 Thread Dylan Beaudette
On Wednesday 25 October 2006 12:02, Roger Bivand wrote:
> On Wed, 25 Oct 2006, Dylan Beaudette wrote:
> > Greetings:
> >
> > are there any simple ways to convert an sp class object to a splancs ppp
> > class object, outside of reading the coordinates and computing a
> > bounding box?
>
> Aren't ppp class objects from the spatstat package? Have you tried the
> spspatstat wrapper package on the R-spatial sourceforge repository? The
> as() coerce method should get you there.
>
> If you really mean splancs, there are not wrappers yet, but are on their
> way.
>
> (Consider posting on R-sig-geo for specific questions like this).
>
> Roger
>
> > cheers,


Thanks for the reply Roger.

I made a slight mistake. I meant to say:

convert sp class object (point / polygon) to a *spatstat* ppp class object.

in the mean time i had come up with the following hack:

# extract data from sp coords slot
# extract data from sp bbox slot

#manually build ppp class object with the ppp() function.

#note that in spatstat the ordering of vertices in a polygon must be in 
counter-clockwise direction, so i had to reverse my vertex vectors.

i will post the worked up examples with data in a bit.

thanks!


-- 
Dylan Beaudette
Soils and Biogeochemistry Graduate Group
University of California at Davis
530.754.7341

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] any good way to convert sp class objects to splancs object

2006-10-25 Thread Roger Bivand
On Wed, 25 Oct 2006, Dylan Beaudette wrote:

> Greetings:
> 
> are there any simple ways to convert an sp class object to a splancs ppp
> class object, outside of reading the coordinates and computing a
> bounding box?

Aren't ppp class objects from the spatstat package? Have you tried the 
spspatstat wrapper package on the R-spatial sourceforge repository? The 
as() coerce method should get you there.

If you really mean splancs, there are not wrappers yet, but are on their 
way.

(Consider posting on R-sig-geo for specific questions like this).

Roger

> 
> cheers,
> 

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: [EMAIL PROTECTED]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] any good way to convert sp class objects to splancs object

2006-10-25 Thread Dylan Beaudette
Greetings:

are there any simple ways to convert an sp class object to a splancs ppp class 
object, outside of reading the coordinates and computing a bounding box?

cheers,
-- 
Dylan Beaudette
Soils and Biogeochemistry Graduate Group
University of California at Davis
530.754.7341

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.