-
-
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
[R-Forge #2412] suffix argument in merge doesn't work #38
Comments
The current solution is not consistent with library(xts)
a <- data.frame(alpha=1:10, beta=2:11)
xts1 <- xts(x=a, order.by=Sys.Date() - 1:10)
b <- data.frame(alpha=3:12, beta=4:13)
xts2 <- xts(x=b, order.by=Sys.Date() - 1:10)
c <- data.frame(alpha=5:14, beta=6:15)
xts3 <- xts(x=c, order.by=Sys.Date() - 1:10)
merge(xts1, xts2, xts3, suffixes=c("A", "B", "C"))
## alpha.A beta.B alpha.C beta.A alpha.B beta.C
## 2022-05-12 10 11 12 13 14 15
## 2022-05-13 9 10 11 12 13 14
## 2022-05-14 8 9 10 11 12 13
## 2022-05-15 7 8 9 10 11 12
## 2022-05-16 6 7 8 9 10 11
## 2022-05-17 5 6 7 8 9 10
## 2022-05-18 4 5 6 7 8 9
## 2022-05-19 3 4 5 6 7 8
## 2022-05-20 2 3 4 5 6 7
## 2022-05-21 1 2 3 4 5 6
merge.zoo(xts1, xts2, xts3, suffixes=c("A", "B", "C"))
alpha.A beta.A alpha.B beta.B alpha.C beta.C
## 2022-05-12 10 11 12 13 14 15
## 2022-05-13 9 10 11 12 13 14
## 2022-05-14 8 9 10 11 12 13
## 2022-05-15 7 8 9 10 11 12
## 2022-05-16 6 7 8 9 10 11
## 2022-05-17 5 6 7 8 9 10
## 2022-05-18 4 5 6 7 8 9
## 2022-05-19 3 4 5 6 7 8
## 2022-05-20 2 3 4 5 6 7
## 2022-05-21 1 2 3 4 5 6 |
Suffixes were not in the correct order. This commit orders the suffixes the same as merge.zoo(). See #38.
Hi Joshua, sorry it took me some time to revert back. I've tried the fix and it exceeded my expectation (in a good way). When I was doing
They are both of Thanks for the swift fix. |
Awesome, thanks for confirming it's fixed for you! |
Submitted by: Alex Chernyakov
Assigned to: Nobody
R-Forge link
When trying to merge to xts objects, it doesn't look like the suffixes arg is working properly:
The text was updated successfully, but these errors were encountered: