f_NAs argument is added. Compatible with both memb_dim and cat_dim cases but only compatible with dat_dim = 1