Closed dokato closed 2 years ago
Thanks @dokato. Could you provide a full reprex?
Sure, see below:
library(nat)
mid_point = colMeans(xyzmatrix(Cell07PNs[[1]]))
trimmed_partners <- subset(Cell07PNs[2:11], filterfun = function(x) {
sq_diffs <- t(t(x) - mid_point)^2
sqrt(rowSums(sq_diffs)) < 100
})
Actually, while writing that I realised that the subset.neuronlist
and subset.neuron
serve very different purpose. I wanted to extrapolate points selection from a single neuron and extend it to a collection, whereas subset.neuronlist
let's you select specific neruons from a list, given the condition (which might be specified by function).
Well, in that case using nlapply
sounds logical...
For a neuronlist of neurons when I call:
getting
Following the suggesting, I tried with
filterfun
:but this fails too. I can make it work with nlapply, but I thought that subset with
filterfun
should work in that case.