KentonWhite / ProjectTemplate

A template utility for R projects that provides a skeletal project.
http://projecttemplate.net
GNU General Public License v3.0
622 stars 159 forks source link

What to do with objects that have more than one class? #87

Closed krlmlr closed 6 years ago

krlmlr commented 10 years ago

https://github.com/johnmyleswhite/ProjectTemplate/blob/master/R/load.project.R#L255

This if is technically wrong, and will warn if the object has more than one class. For instance:

> class(data.table::data.table())
[1] "data.table" "data.frame"

Should everything that is a data frame be converted to a data table (any(...)), or should only "pure" data frames be converted to data tables (all(...))?

Implementing the second option as part of #76, still open for discussion.

krlmlr commented 9 years ago

The commit is bad, should be any instead of all (or an inherits() call).