Bioconductor / S4Vectors

Foundation of vector-like and list-like containers in Bioconductor
https://bioconductor.org/packages/S4Vectors
17 stars 20 forks source link

DataFrame constructors and stringsAsFactors #13

Closed wolfganghuber closed 6 years ago

wolfganghuber commented 6 years ago

The documentation says " On the whole, the ‘DataFrame’ behaves very similarly to ‘data.frame’, in terms of construction, subsetting, splitting, combining, etc." but I understand that 'stringsAsFactors' arguments are expanded as data columns. For easier exchangeability with regular 'data.frame' and reducing programmers' mental load, why not have the constructors accept the 'stringsAsFactors' argument, complain if its not TRUE, and then swallow it?

lawremi commented 6 years ago

DataFrame() doesn't actually ensure one behavior or the other, as it all depends on the coercion of each argument to DataFrame. Thus, I made it so that DataFrame() ignores stringsAsFactors and warns if it is non-missing. Thanks for the suggestion.