No, cannot agree. The result of using an n by 2 matrix to index into a rectangular object is a vector. A vector can only have one storage mode for all elements. Some type coercion is necessary to accommodate this. -- Sent from my phone. Please excuse my brevity.
On December 17, 2016 2:58:24 PM PST, David Winsemius <dwinsem...@comcast.net> wrote: > >> On Dec 17, 2016, at 11:34 AM, Bert Gunter <bgunter.4...@gmail.com> >wrote: >> >> It's documented, David: >> >> From ?"[.data.frame" >> >> "Matrix indexing (x[i] with a logical or a 2-column integer matrix i) >> using [ is not recommended. For extraction, x is first coerced to a >> matrix..." >> >> ergo characters for a mixed mode frame. > >Can we agree that it is most ironic that `[<-.data.frame` does not >impose coercion on its `x` argument with a 2 column matrix as `i`, but >that `[.data.frame` does? I had initially assumed that the coercion had >occurred at the time of assignment which would have made more sense (to >me, anyway). ______________________________________________ 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.