NAs are not allowed in subscripted assignments
Hi! I am analyzing my data from a web experiment, and when I try to run this command:
sst_mt <- mt_import_mousetrap(df_sst, xpos_label = 'mouse_sst.x', ypos_label = 'mouse_sst.y', timestamps_label = 'mouse_sst.time') sst_mt$data$pos_var <- apply(sst_mt$trajectories[,,"xpos"],1,var,na.rm=TRUE) + apply(sst_mt$trajectories[,,"ypos"],1,var,na.rm=TRUE) # Check if there are trials with 0 variance (i.e., all positions are identical) table(sst_mt$data$pos_var==0) # Only keep trials where positions varied sst_mt <- mt_subset(sst_mt, pos_var>0) sst_mt <- mt_time_normalize(sst_mt) sst_mt <- mt_align_start(sst_mt) sst_mt <- mt_derivatives(sst_mt) sst_mt <- mt_measures(sst_mt)
I get the following error message:
Error in current_dev_ideal[to_flip_dev_ideal] <- -current_dev_ideal[to_flip_dev_ideal] : NAs are not allowed in subscripted assignments
as you can see, I have eliminated trials with no movement. Any help would be greatly appreciated!