[adegenet-forum] problem for editing a neighbours list

jombart at biomserv.univ-lyon1.fr jombart at biomserv.univ-lyon1.fr
Thu Oct 2 13:23:13 CEST 2008


Didier Bouchel wrote:
> Dear all
>
>
> I need to add links in a connection network.
> I have a problem for editing the the neighbours list using edit.nb
> (function chooseCN) :
>
>  > gab <- chooseCN (xycoord, ask = FALSE, type = 2, result.type = "nb",
> plot.nb=TRUE , edit.nb=TRUE)
>
> returns the following error message :
>
>            Erreur dans inherits(x, "nb") : objet "x" non trouvé
>
>
> plot.nb works properly but edit.nb doesn't.
>
> How can I edit the links ?
>
> Thanks
>
> Didier Bouchel
> _______________________________________________
> adegenet-forum mailing list
> adegenet-forum at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/adegenet-forum
>
>
>
Dear Didier,

This is apparently a small bug in the function edit.nb from the spdep package.
To fix it, type fix(edit.nb) and then replace :
  if (!inherits(x, "nb"))
        stop("not a neighbours list")
with
 if (!inherits(nb, "nb"))
        stop("not a neighbours list")

After this you can just use edit.nb as expected.
I'll email Roger Bivand to bug-report, it should be fixed soon.

Best,

Thibaut.

-- 
######################################
Thibaut JOMBART
CNRS UMR 5558 - Laboratoire de Biométrie et Biologie Evolutive
Universite Lyon 1
43 bd du 11 novembre 1918
69622 Villeurbanne Cedex
Tél. : 04.72.43.29.35
Fax : 04.72.43.13.88
jombart at biomserv.univ-lyon1.fr
http://biomserv.univ-lyon1.fr/%7Ejombart/
http://adegenet.r-forge.r-project.org/




--------------------------------------------------------------------------
Ce message a été envoyé depuis le webmail IMP (Internet Messaging Program)


More information about the adegenet-forum mailing list