Skip to content

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

Closed

Description

@joshuaulrich

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

Activity

  1. self-assigned this
    on Feb 21, 2023
  2. added this to the 0.13.1 milestone on Feb 23, 2023
  3. 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[/+] on Feb 28, 2023
  4. added a commit that references this issue on Aug 15, 2026
    548f313
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions