Commit f6f458dc authored by Enrico Schumann's avatar Enrico Schumann

[read_ts_tables] Rename argument 'column.name' to 'column.names'

parent 2c77da2c
2017-06-08 Enrico Schumann <es@enricoschumann.net>
* R/functions.R (read_ts_tables): rename
argument 'column.name' to 'column.names' (plural)
2017-05-26 Enrico Schumann <es@enricoschumann.net>
* R/functions.R (write_ts_table): rename first
......
......@@ -147,7 +147,7 @@ read_ts_tables <- function(file, dir, t.type = "guess",
start, end, columns,
return.class = NULL,
drop.weekends = TRUE,
column.name = "%dir%/%file%::%column%",
column.names = "%dir%/%file%::%column%",
backend = "csv") {
backend <- tolower(backend)
......@@ -243,7 +243,7 @@ read_ts_tables <- function(file, dir, t.type = "guess",
rm <- rowSums(is.na(results)) == dim(results)[[2L]]
results <- results[!rm, ,drop = FALSE]
timestamp <- timestamp[!rm]
colnames <- rep.int(column.name, dim(results)[[2L]])
colnames <- rep.int(column.names, dim(results)[[2L]])
.dir <- rep(dir, each = length(columns))
.file <- rep(file, each = length(columns))
.columns <- rep(columns, length(.dir)/length(columns))
......
......@@ -422,11 +422,20 @@ In read_ts_tables(c("example1", "example2"), dir = "~/tsdb/daily", :
** ts_tables
tsdb works with /time-series tables/ (=ts_tables=). These are
numeric matrices, so there is always a =dim= attribute. Attached to
this matrix are several attributes:
tsdb works with /time-series tables/
(=ts_tables=). These are numeric matrices, so there
is always a =dim= attribute. For a time-series table
=x=, you get the number of observations with =dim(x)[[1]]=
Attached to this matrix are several attributes:
- timestamp :: the timestamp, which can be either of class Date or of
class =POSIXct=
- columns :: a character vector that provides the columns names
(There may be other attributes as well, but these two
are always present.)
- timestamp :: the numeric representation of the timestamp
** The file format
......
......@@ -11,7 +11,7 @@ read_ts_tables(file, dir, t.type = "guess",
start, end, columns,
return.class = NULL,
drop.weekends = TRUE,
column.name = "\%dir\%/\%file\%::\%column\%",
column.names = "\%dir\%/\%file\%::\%column\%",
backend = "csv")
}
\arguments{
......@@ -39,7 +39,7 @@ read_ts_tables(file, dir, t.type = "guess",
\item{drop.weekends}{
logical
}
\item{column.name}{
\item{column.names}{
character: a format string for column names; may contain
\code{\%dir\%}, \code{\%file\%}, and \code{\%column\%}
......
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