Skip to content
Prev 384622 / 398525 Next

Help with looping a function over a list of dataframes:

Hello thanks everyone for your help i managed to get a working function as
followed:

for(i in 2:length(list_df)){
list_df[[paste0("position_tab_",i)]][['ID']] <-
 unlist(lapply(list_df[[paste0("position_tab_",i)]][['midpoint']],
function(x)
  ifelse(any(abs(x - list_df[[paste0("position_tab_",i-1)]][['midpoint']])
                       <= 1),1,0)         )) }

The idea with this was to detect stationary mitochondria from each frame.
So i needed to link objects from frame to frame (pos_tab = one frame) and
find any of them that didnt move more than 2 pixels hence the +/- one
requirement.
On Sat, 4 Jul 2020 at 16:25, Bert Gunter <bgunter.4567 at gmail.com> wrote: