Nearest neighbors of a of 3D points

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Nearest neighbors of a of 3D points

Eric Leroy
Hi,

I have a text file that contains the 3D coordinates of points and I want
to plot the histogram of the nearest neighbors distance. I can import
the xyz coordinates in R and each value x, y, z is stored in a numerical
array. I discovered the nndist.pp3 function from the spatstat package
that seems to do what I want. My problem is to create a pp3 object from
the xyz values that I have.

Do you know how to do that ?

Best regards,

--

*Eric Leroy*

/Responsable de la plateforme microscopie électronique/

ICMPE - UMR 7182 - CNRS - UPEC

2/8, rue Henri Dunant

94320 Thiais

Tél : 01.49.78.12.09

Fax : 01.49.78.12.03

courriel : [hidden email] <mailto:[hidden email]>

Page Web : : http://www.icmpe.cnrs.fr


        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.
Reply | Threaded
Open this post in threaded view
|

Re: Nearest neighbors of a of 3D points

David Carlson
What have you tried so far? Have you installed the spatstat package and read the manual page for pp3 objects? The website spatstat.org has additional support including a quick reference guide. There are always multiple ways to do something in R, but without more details it is hard to be specific. Nearest neighbor distances are also provided in several other packages, e.g. packages FNN, distances, and RANN.

----------------------------------------
David L Carlson
Department of Anthropology
Texas A&M University
College Station, TX 77843-4352

-----Original Message-----
From: R-help <[hidden email]> On Behalf Of Eric Leroy
Sent: Wednesday, February 6, 2019 2:37 AM
To: [hidden email]
Subject: [R] Nearest neighbors of a of 3D points

Hi,

I have a text file that contains the 3D coordinates of points and I want
to plot the histogram of the nearest neighbors distance. I can import
the xyz coordinates in R and each value x, y, z is stored in a numerical
array. I discovered the nndist.pp3 function from the spatstat package
that seems to do what I want. My problem is to create a pp3 object from
the xyz values that I have.

Do you know how to do that ?

Best regards,

--

*Eric Leroy*

/Responsable de la plateforme microscopie électronique/

ICMPE - UMR 7182 - CNRS - UPEC

2/8, rue Henri Dunant

94320 Thiais

Tél : 01.49.78.12.09

Fax : 01.49.78.12.03

courriel : [hidden email] <mailto:[hidden email]>

Page Web : : http://www.icmpe.cnrs.fr


        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.
______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.
Reply | Threaded
Open this post in threaded view
|

Re: Nearest neighbors of a of 3D points

Eric Leroy
I tried the spatstat package. In the meanwhile, I think that I found the
solution: with the pp3 command, I was able to create a pp3 object that
is recognized by nndist.

I will give a look at the other packages you mentioned seeing what are
the differences.

Anyway, thank you for your answer.

*Eric Leroy*

/Responsable de la plateforme microscopie électronique/

ICMPE - UMR 7182 - CNRS - UPEC

2/8, rue Henri Dunant

94320 Thiais

Tél : 01.49.78.12.09

Fax : 01.49.78.12.03

courriel : [hidden email] <mailto:[hidden email]>

Page Web : : http://www.icmpe.cnrs.fr

Le 06/02/2019 à 17:06, David L Carlson a écrit :

> What have you tried so far? Have you installed the spatstat package and read the manual page for pp3 objects? The website spatstat.org has additional support including a quick reference guide. There are always multiple ways to do something in R, but without more details it is hard to be specific. Nearest neighbor distances are also provided in several other packages, e.g. packages FNN, distances, and RANN.
>
> ----------------------------------------
> David L Carlson
> Department of Anthropology
> Texas A&M University
> College Station, TX 77843-4352
>
> -----Original Message-----
> From: R-help <[hidden email]> On Behalf Of Eric Leroy
> Sent: Wednesday, February 6, 2019 2:37 AM
> To: [hidden email]
> Subject: [R] Nearest neighbors of a of 3D points
>
> Hi,
>
> I have a text file that contains the 3D coordinates of points and I want
> to plot the histogram of the nearest neighbors distance. I can import
> the xyz coordinates in R and each value x, y, z is stored in a numerical
> array. I discovered the nndist.pp3 function from the spatstat package
> that seems to do what I want. My problem is to create a pp3 object from
> the xyz values that I have.
>
> Do you know how to do that ?
>
> Best regards,
>
______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.