Maybe a better solution instead of "don't do it!" might be to change:
x[[j]] <- if(length(dim(xj)) != 2L) xj[i] else xj[i, , drop = FALSE] at: https://github.com/wch/r-source/blob/trunk/src/library/base/R/dataframe.R#L712 to: x[[j]] <- if(length(dim(xj)) < 2L) xj[i] else do.call("[",c(list(xj,i), rep(list(bquote()), length(dim(xj))-1L), list(drop = FALSE))) Would this be possible and work? Thanks! Georg Gesendet: Freitag, 26. Mai 2023 um 21:05 Uhr Von: "Bert Gunter" <bgunter.4...@gmail.com> An: "Georg Kindermann" <georg.kinderm...@gmx.at> Cc: "Rui Barradas" <ruipbarra...@sapo.pt>, r-help@r-project.org, "Jeff Newmiller" <jdnew...@dcn.davis.ca.us> Betreff: Re: Re: Re: [R] data.frame with a column containing an array Please refer to Jeff Newmiller's response. I believe that your further exploration of indexing a data frame containing an array column demonstrates his point: don't do it! As this discussion could now devolve into a morass of personal opinion (such as the above), if you or others care to continue, please do so **offlist**. However, I have nothing further to say in any case. Cheers, Bert ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.