Dear Emma,

The main difference between PCNM::PCNM and vegan::pcnm functions is that
PCNM provides an immediate assessment of the spatial autocorrelation
(Moran's I) displayed by the computed eigenfunctions. The problem with your
data is that the computation of Moran's I is stopped, probably due to your
triangular distance matrix. The solution is to skip this assesment by
specifying the following code:
PCNM.auto <- PCNM(dist, moran=FALSE)
The result is simular to this of vegan::pcnm, PCNM vectors differing only by
a multiplicative parameter.

Cheers,

François


-------------------------------------------------------------------------------
Prof. François Gillet
Community ecology and dynamic modelling
-------------------------------------------------------------------------------
 Université de Franche-Comté - CNRS
UMR 6249 Chrono-environnement
UFR Sciences et Techniques
16, Route de Gray
F-25030 Besançon cedex
France

http://chrono-environnement.univ-fcomte.fr/
 http://chrono-environnement.univ-fcomte.fr/spip.php?article530
Phone: +33 (0)3 81 66 62 81
Location: La Bouloie, Bât. Propédeutique, *-114L*
-------------------------------------------------------------------------------
Ecole Polytechnique Fédérale de Lausanne
EPFL - ENAC - IIE – ECOS
Ecological Systems Laboratory
Station 2 - Ecublens
CH-1015 Lausanne
 Switzerland
-------------------------------------------------------------------------------

*Now available!*


"Numerical Ecology with R", by D. Borcard, F. Gillet and P. Legendre
 http://www.springer.com/978-1-4419-7975-9
-------------------------------------------------------------------------------
Designed with WiseStamp -
<http://r1.wisestamp.com/r/landing?u=a0152f9a0c4ca423&v=2.8.5&t=1317851097278&promo=10&dest=http%3A%2F%2Fwww.wisestamp.com%2Femail-install%3Futm_source%3Dextension%26utm_medium%3Demail%26utm_campaign%3Dpromo_10>Get
yours<http://r1.wisestamp.com/r/landing?u=a0152f9a0c4ca423&v=2.8.5&t=1317851097278&promo=10&dest=http%3A%2F%2Fwww.wisestamp.com%2Femail-install%3Futm_source%3Dextension%26utm_medium%3Demail%26utm_campaign%3Dpromo_10>



2011/10/5 Emma Gothe <Emma.Gothe@slu.se>

> Thank you Jari for a fast reply!
>
> I will try the vegan function asap as it seems to work smoothly. I am still
> wondering what causes the problem in the PCNM () function though... If
> anyone else knows, then please let me know.
>
> Best Emma
>
> -----Ursprungligt meddelande-----
> Från: Jari Oksanen [mailto:jari.oksanen@oulu.fi]
> Skickat: den 5 oktober 2011 12:46
> Till: Emma Gothe
> Kopia: r-sig-ecology@r-project.org
> Ämne: Re: [R-sig-eco] Help PCNM analysis
>
> On Wed, 2011-10-05 at 10:25 +0200, Emma Gothe wrote:
> > Dear list members!
> >
> > I am trying to perform a PCNM analysis with function PCNM() (binary
> package provided by the provided by project Spatial ecological data analysis
> with R). I recently ran into a problem. I have a triangular distance matrix
> based on the shortest distance between my sampling points which I am using
> in the PCNM function instead of geographic coordinates. When I tried to
> perform the analysis on this distance matrix I got an error message (see
> below) that says I have "empty neighbor sites". I have used the same code
> and the exactly same type of distance matrices before and I did not have any
> problem. I have also searched my distance matrix for ev. missing
> values/other obvious errors and tried to search for a solution online but
> without any luck.
> >
> > The file "Eucl stream order1.txt" is attached and my code is:
> >
> > > dist.matr <- read.delim("Eucl stream order1.txt",row.names=1)
> > > dist <- as.dist(dist.matr)
> > > PCNM.auto=PCNM(dist)
> > Truncation level = 1092.48
> > Error in as.matrix(listw2sn(nb2listw(nb))[, 1:2]) :
> >   error in evaluating the argument 'x' in selecting a method for function
> 'as.matrix': Error in nb2listw(nb) : Empty neighbour sets found
> > Timing stopped at: 0.01 0 0.02
> >
> > If anyone could help me to figure this out, and have suggestions for a
> solution I would be very greatful!
> >
> Emma,
>
> I don't know about the PCNM package, but the matrix goes smoothly true
> vegan::pcnm:
>
> > library(vegan)
> Loading required package: permute
> This is vegan 2.0-0
> > dist.matr <- read.delim("Eucl stream order1.txt",row.names=1)
> > dist <- as.dist(dist.matr)
> > p <- pcnm(dist)
> > str(p)
> List of 4
>  $ vectors  : num [1:30, 1:19] -0.2245 -0.2239 -0.2249 -0.2907
> -0.0212 ...
>  ..- attr(*, "dimnames")=List of 2
>  .. ..$ : chr [1:30] "A2" "A3" "A4" "A5" ...
>  .. ..$ : chr [1:19] "PCNM1" "PCNM2" "PCNM3" "PCNM4" ...
>  $ values   : num [1:29] 71640230 66080002 58129580 29179643
> 16447538 ...
>  $ weights  : num [1:30] 1 1 1 1 1 1 1 1 1 1 ...
>  $ threshold: num 1092
>  - attr(*, "class")= chr "pcnm"
>
> Cheers, Jari Oksanen
> _______________________________________________
> R-sig-ecology mailing list
> R-sig-ecology@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>

	[[alternative HTML version deleted]]

