RData.jl
RData.jl copied to clipboard
Add "unique_colnames" keyword option to load()
As mentioned in #44 , it would be nice to add unique_colnames=true
option to load()
, which would propagate to DataFrame({r data frame}, makeunique=unique_colnames)
.
That will make the default behaviour reasonable, while still allowing the user to control it.
Why not call that argument makeunique
for consistency?
Why not call that argument
makeunique
for consistency?
load()
can return different objects. I'm not sure it is as clear as in DataFrame
ctor that makeunique
refers to the columns of data frames (or matrices). What if the user expects a vector of strings, then makeunique
(which defaults to true) would be really confusing.
Yeah, maybe. However, it's not very explicit either for the DataFrame
constructor (where it could also mean e.g. that rows should all be unique).
I would be very much in favor of using the same corrected keyword as DataFrame
ctor. Maybe something like uniquenames
? Or fixnames
, meaning that it will both make the name unique and a correct Julia identifier. In case of load("*.rda")
it can potentially apply to DataFrame
column names, matrix row/column names, list/vector element names, top level identifier names (variables).
Makes sense. We need a quite strong motivation to change the name in DataFrames though, given the burden it imposes on users.