Skip to content
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

as.xts.data.frame drops column name for data.frame with 1 non-time-based column #391

Closed
joshuaulrich opened this issue Feb 21, 2023 · 0 comments
Assignees
Labels
Milestone

Comments

@joshuaulrich
Copy link
Owner

joshuaulrich commented Feb 21, 2023

No column name for data.frames with one column (other than the time-based column). Works correctly for more than non-time-based column.

require(xts)
packageVersion("xts")
## [1] '0.13.0'

x <- data.frame(Index = as.Date("2023-02-21"), Value = 21)
as.xts(x)
##            [,1]
## 2023-02-21   21

y <- data.frame(Index = as.Date("2023-02-21"), A = 21, B = 42)
as.xts(y)
##             A  B
## 2023-02-21 21 42
@joshuaulrich joshuaulrich self-assigned this Feb 21, 2023
@joshuaulrich joshuaulrich added this to the 0.13.1 milestone Feb 23, 2023
@joshuaulrich joshuaulrich changed the title as.xts.data.frame drops column name for 1-column data.frame as.xts.data.frame drops column name for data.frame with 1 non-time-based column Feb 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant