[Spdep-devel] spdep [.nb

Roger Bivand Roger.Bivand at nhh.no
Fri Mar 3 21:17:11 CET 2017


Dear Dale,

There are no "all" here, so writing directly to me as maintainer would 
have been easier for you too. I'll take a look at your suggestion next 
week - thanks for considering contributing!

Best wishes,

Roger

On Thu, 2 Mar 2017, Dale wrote:

> Dear all,
>
> For my own project, I've found it necessary to implement a '[.nb'
> function.
>
> I'm dealing with spatial and neighbour data, which is provided unsorted
> https://github.com/mm0hgw/contiguity/blob/master/test/pics/layerTag_test_OS2010.png
>
> and in order to more easily match electoral data to the country and it's
> sub-regions, I'm using 'sp[i,]' to both sort and subset the spatial
> data.
> https://github.com/mm0hgw/contiguity/blob/master/test/pics/regionTag_test_UK.Wm.Scotland.2010.png
>
> Where 'nb <- poly2nb(sp)'
> With the presence of '[.nb' it is possible to use the same 'i' from
> 'sp[i,]' to do nb[i] and thus get the result of 'poly2nb(sp[i,])' more
> cheaply.
>
> I am fairly certain a '[.nb' function more properly belongs in 'spdep'
> with 'subset.nb' than in my project.
>
> https://github.com/mm0hgw/contiguity/blob/v0.1.7/contiguity/R/nb.edit.R
> The function '[.nb' is defined from line 36.
>
> It currently has minimal documentation for 'devtools::check()' to
> refrain from complaint, and no examples.
>
> Yours
> Dale
>
>
> _______________________________________________
> Spdep-devel mailing list
> Spdep-devel at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/spdep-devel
>

-- 
Roger Bivand
Department of Economics, Norwegian School of Economics,
Helleveien 30, N-5045 Bergen, Norway.
voice: +47 55 95 93 55; e-mail: Roger.Bivand at nhh.no
Editor-in-Chief of The R Journal, https://journal.r-project.org/index.html
http://orcid.org/0000-0003-2392-6140
https://scholar.google.no/citations?user=AWeghB0AAAAJ&hl=en
http://depsy.org/person/444584


More information about the Spdep-devel mailing list