nat
nat copied to clipboard
Allow xyzmatrix method to assign by rownames
When I try to assign soma positions to neurolist metadata with xyzmatrix
I get only this warning
> xyzmatrix(dps5[,]) <- xyzmatrix(meta)
Warning message:
In matrix(value, n, p) :
data length [21] is not a sub-multiple or multiple of the number of rows [5]
that results in completely messed up values. See toy data to reproduce.
Expected
xyzmatrix
recognizes and assigns positions based on rownames of a larger set of neuron body ids from the RHS.
Probably a new xyzmatrix
<-matrix` function needed here?
Hmm. That is not something I have tried to do in the past. I guess it would be convenient in this scenario, but I wonder if at some point it might be a little fragile. This method will not know that it is a neuronlist attached data.frame, it could be any old data.frame or matrix and we use it a lot in that more general context.