[R] In praise of "options(warnPartialMatchDollar = TRUE)"

David Winsemius dwinsemius at comcast.net
Sun Nov 27 23:15:47 CET 2016


> On Nov 27, 2016, at 2:03 PM, Bert Gunter <bgunter.4567 at gmail.com> wrote:
> 
> ...
>> 
>> After either method, you can `cbind` to that dfrm object to your heart's content, because the cbind.data.frame method is dispatched.
>> 
>> --
>> David.
>> 
> 
> ... But of course, this is unnecessary anyway, as:
> 
> "The cbind data frame method is just a wrapper for data.frame(...,
> check.names = FALSE). This means that it will split matrix columns in
> data frame arguments, and convert character columns to factors unless
> stringsAsFactors = FALSE is specified."

Good point especially the reminder about the stringsAsFactors pitfall. The factor call to create my example was superfluous, but if I had included a character column the print method for dataframes would h=not have warned me anyway. Neither does the print method for data.tables. Only the print method for the dplyr-tibble objects gives a clear indication of factor-classed columns.

--
Best;

David Winsemius
Alameda, CA, USA



More information about the R-help mailing list