Occasionally it happened to me that I needed to get some metadata information about the neuron that is kept in data.frame attribute. For example, I have a function that does action A if the neuron has soma, and action B if it doesn't. So far to achieve that I had to work around nlapply. I thought that including such metadata as attributes during iteration would be nice though. I.e.:
soma_radius <- function(n) {
if (isTRUE(n$soma))
n$d[n$d$Parent == -1,"W"]
else
0
}
Occasionally it happened to me that I needed to get some metadata information about the neuron that is kept in data.frame attribute. For example, I have a function that does action A if the neuron has soma, and action B if it doesn't. So far to achieve that I had to work around
nlapply. I thought that including such metadata as attributes during iteration would be nice though. I.e.: