Commit 74d6e678 authored by Enrico Schumann's avatar Enrico Schumann

Fix 'as.zoo.ts_table'

ttime: 'strip.attr' is TRUE by default (i.e. a timezone
attribute is dropped)
parent c6a8951f
2017-10-24 Enrico Schumann <es@enricoschumann.net>
* R/functions.R (as.zoo.ts_table): fix method
* inst/unitTests/ut_write_read.R
(test.ts_table): fix unit tests
* R/functions.R (ttime): 'strip.attr' is TRUE
by default (i.e. a timezone attribute is
dropped)
2017-09-14 Enrico Schumann <es@enricoschumann.net>
* R/functions.R (file_info): return more
......
......@@ -5,7 +5,7 @@
## ---------------- time
ttime <- function(x, from = "datetime", to = "numeric",
tz = "", strip.attr = FALSE,
tz = "", strip.attr = TRUE,
format = "%Y-%m-%d") {
if (from == "datetime" && to == "numeric") {
......@@ -390,7 +390,8 @@ as.ts_table.zoo <- function(x, columns, ...) {
}
as.zoo.ts_table <- function(x, ...) {
ans <- zoo(unname(as.matrix(x)), .timestamp(x))
ans <- zoo(unname(as.matrix(x)),
ttime(.timestamp(x), "numeric", .t.type(x)))
colnames(ans) <- .columns(x)
ans
}
......@@ -419,7 +420,9 @@ as.matrix.ts_table <- function(x, ...) {
ans <- c(x)
dim(ans) <- d
colnames(ans) <- col
rownames(ans) <- as.character(ttime(timestamp, from = "numeric", to = .t.type(x)))
rownames(ans) <- as.character(ttime(timestamp,
from = "numeric",
to = .t.type(x)))
ans
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment