You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment if a numeric id e.g. that used as the unique identified for a neuron in a database is used to index a neuronlist, it will be interpreted as an int. This is not what one wants. The current workaround is to convert such ids to character vectors before the indexing call, but this must be done explicitly. Perhaps we could make a simple class e.g. nlid that would indicate that the contents (which could be any class including R primitives) should be used for indexing by equality not by position.
tenthousandneurons=read.neurons("bigfolder")
# ouch
tenthousandneurons[12134567]
# ok
tenthousandneurons[as.character("12134567")]
# a (little bit) better
tenthousandneurons[nlid(12134567)]
# likewise
plot3d(tenthousandneurons, nlid(12134567))
# could work with `plot3d.nlid` method (which could just pass through to `plot3d.character`)
plot3d(nlid(12134567))
# But more useful would be e.g.
x=read.neurons.catmaid(nlid(...))
selids=find.neurons(x)
plot3d(x, selids)
The text was updated successfully, but these errors were encountered:
where it is assumed that if our subset is not a character then we should be using it to subset literally the names of the neuronlist. We would instead need to have special case logic for nlid or be more restrictive in which types we continue to convert into names.
At the moment if a numeric id e.g. that used as the unique identified for a neuron in a database is used to index a
neuronlist
, it will be interpreted as anint
. This is not what one wants. The current workaround is to convert such ids to character vectors before the indexing call, but this must be done explicitly. Perhaps we could make a simple class e.g.nlid
that would indicate that the contents (which could be any class including R primitives) should be used for indexing by equality not by position.The text was updated successfully, but these errors were encountered: