natverse / nat

NeuroAnatomy Toolbox: An R package for the (3D) visualisation and analysis of biological image data, especially tracings of single neurons.
https://natverse.org/nat/
62 stars 26 forks source link

fix bug in matching by first column #503

Closed jefferis closed 1 year ago

jefferis commented 1 year ago

This change in #467 introduced a subtle bug:

https://github.com/natverse/nat/blob/49d578d65c5290ad7b2e31c9bb5984c7c2126991/R/neuronlist.R#L301

If the first column of the incoming dataframe is numeric then intersect(nn, value[,1]) will be numeric as well, which will cause indexing to fail.