Which behavior should be expected from merge.xts
regarding suffixes?
#371
Labels
enhancement
Enhancement to existing feature
Milestone
Description
As a newcomer to the
xts
package, I truly appreciate the intuitive way this package makes it possible to deal with time series in R. Yet I am still puzzled by the behavior of themerge.xts
function, although I understand some way has been walked since the latest release of the package. Especially regarding suffixes, the function adds an extra dot separator between the former name of the column(s) and the suffix, even though you specify an empty suffix (which should be regarded as the will to leave the name of the column unchanged in my opinion). I am aware this is consistent with themerge.zoo
function, yet as a naive user, I would rather expect a behaviour of such function consistent with themerge.default
ormerge.data.frame
, especially for features that are set through same parameters.Expected behavior with minimal reproductible example
Taking example from previous issues, here's a piece of code and its current behavior with the dev version of the package:
Here I obtain columns with suffixes
.
,.t_1
and.t_2
, although it may not be my wish to get such a dot (especially for the first set of columns). I would expect to be able to specify the whole suffix the waymerge.default
does (in this case, I choose to specify_
rather than.
just for the sake of the example):In my opinion, it would be a more intuitive way of dealing with suffixes, also assuming you would like to implement a treatment on time series mimicking as much as possible the way dataframes are processed in R.
Browsing the code, it looks like I can see which lines would have to be adapted to address the issue the way I am suggesting. I would be more than happy to have a try and submit a PR, would you find this opinion agreeable to some point.
The text was updated successfully, but these errors were encountered: