-
-
Notifications
You must be signed in to change notification settings - Fork 71
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
Which behavior should be expected from merge.xts
regarding suffixes?
#371
Comments
Thanks for the report/comment and pointing out that the I think we can make That said, it's way too late to make that change to It would be great if you could submit a PR! Change the 2 unit tests first and that will help ensure your changes do what you expect. |
Thanks for the suggestion. I have just added an argument
Then we can set up data similar to that in the post above:
And then we can assign custom suffixes with a custom separator like this:
In this application I agree it would be more convenient to just set the Let me know if you notice anything that doesn't work as intended and/or advertised. |
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: