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

[R-Forge #5416] index<-.xts and indexClass<-.xts do not correctly set TZ when value is 'Date' #50

Closed
joshuaulrich opened this issue Feb 26, 2015 · 1 comment
Assignees
Labels

Comments

@joshuaulrich
Copy link
Owner

Submitted by: Joshua Ulrich
Assigned to: Joshua Ulrich
R-Forge link

> x <- .xts(1:3,1:3)
> index(x) <- as.Date(index(x))
> attributes(x)
$dim
[1] 3 1

$index
[1] 0 0 0
attr(,'tclass')
[1] 'Date'

$.indexCLASS
[1] 'Date'

$.indexTZ
[1] ''

$tclass
[1] 'POSIXt'  'POSIXct'

$tzone
[1] ''

$class
[1] 'xts' 'zoo'

>
> y <- .xts(1:3,1:3)
> indexClass(y) <- 'Date'
> attributes(y)
$dim
[1] 3 1

$index
[1] 1 2 3
attr(,'tzone')
[1] ''
attr(,'tclass')
[1] 'Date'

$.indexCLASS
[1] 'Date'

$.indexTZ
[1] ''

$tclass
[1] 'POSIXt'  'POSIXct'

$tzone
[1] ''

$class
[1] 'xts' 'zoo'
@joshuaulrich joshuaulrich self-assigned this Mar 9, 2015
@joshuaulrich
Copy link
Owner Author

Closing because I can no longer replicate this. It was probably fixed as part of #245.

x <- .xts(1:3,1:3)
index(x) <- as.Date(index(x))
attributes(x)
## $dim
## [1] 3 1
## 
## $index
## [1] 0 0 0
## attr(,"tclass")
## [1] "Date"
## attr(,"tzone")
## [1] "UTC"
## 
## $class
## [1] "xts" "zoo"
## 
y <- .xts(1:3,1:3)
tclass(y) <- 'Date'
attributes(y)
## $dim
## [1] 3 1
## 
## $index
## [1] 1 2 3
## attr(,"tclass")
## [1] "Date"
## attr(,"tzone")
## [1] "UTC"
## 
## $class
## [1] "xts" "zoo"

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