-
Notifications
You must be signed in to change notification settings - Fork 417
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Should gather default to character instead of factor for the key column? #96
Comments
I used it in order to preserve the order of the columns, which is sometimes important. It's fairly easy to control in reshape2 via the |
I would also be interested in |
Adding my $0.02USD in support of |
Any ideas about what to call the argument? I'm going with |
gather
currently dispatches toreshape2::melt
, and the resulting key column is of typefactor
, unlessconvert=TRUE
is specified, in which case it’s converted to another type, depending on the actual data.This default makes sense if the resulting table is used with modelling functions, but not much else. In particular, a very common workflow for me is to use
gather
followed byinner_join
, e.g. (wherecounts
is a gene expression experiment consisting of several libraries, andcol_data
is the experiment’s column data, in Bioconductor parlance, i.e. describes the experiments):This invariably yields a warning from
inner_join
:And while harmless, it’s a bit annoying, especially as this is usually in a knitr document and I don’t want to clutter my output.
convert=TRUE
isn’t really what I want: For instance, I almost always want the result to be of typecharacter
, regardless of the actual data format.Am I right in thinking that using
factor
rather thancharacter
as the type of the key column is more for historical reasons than actually due to a hard advantage? Would it make sense to change the default?The text was updated successfully, but these errors were encountered: