Commit fad5effa authored by Enrico Schumann's avatar Enrico Schumann

See ChangeLog

parent 17bfccef
2017-03-16 Enrico Schumann <es@enricoschumann.net>
* R/functions.R (.columns, `.columns<-`)
(.t.type, `.t.type<-`): add internal functions
(write_ts_table): new argument 'backend'
(read_ts_tables): new argument 'backend'
* NAMESPACE: import from package DBI
* R/functions.R (as.matrix.ts_table): add method
2017-02-06 Enrico Schumann <es@enricoschumann.net>
* DESCRIPTION (Version): 0.4-1
......
Package: tsdb
Type: Package
Title: Terribly-Simple Data Base for Time Series
Version: 0.4-1
Date: 2017-02-06
Version: 0.4-2
Date: 2017-03-16
Maintainer: Enrico Schumann <es@enricoschumann.net>
Authors@R: person("Enrico", "Schumann",
role = c("aut", "cre"),
......@@ -12,4 +12,4 @@ Description: A terribly-simple data base for time series. All
saving files in a standardised format, and for retrieving and
joining data.
License: GPL-3
Imports: datetimeutils, fastmatch, utils, zoo
Imports: DBI, datetimeutils, fastmatch, utils, zoo
......@@ -5,6 +5,12 @@ export(
as.ts_table
)
importFrom("DBI",
"dbGetQuery",
"dbQuoteIdentifier",
"dbWriteTable"
)
importFrom("datetimeutils",
"isBusinessDay",
"previousBusinessDay")
......
This diff is collapsed.
......@@ -159,7 +159,7 @@ Start by creating time-series data.
: 1 2 3 4 5
To store these data, we need to enforce a certain
To store these data, we need to enforce a consistent
format, which the functions =ts_table= and
=as.ts_table= do.
......
## -*- truncate-lines: t; fill-column: 65; comment-column: 50; -*-
test.ts_table <- function() {
require("zoo")
x <- ts_table(11:15, as.Date("2016-1-1")-5:1, "close")
......
......@@ -11,7 +11,8 @@ read_ts_tables(file, dir, t.type = "guess",
start, end, columns,
return.class = NULL,
drop.weekends = TRUE,
column.name = "\%dir\%/\%file\%::\%column\%")
column.name = "\%dir\%/\%file\%::\%column\%",
backend = "csv")
}
\arguments{
\item{file}{
......@@ -43,7 +44,11 @@ read_ts_tables(file, dir, t.type = "guess",
character: a format string for column names; may contain
\code{\%dir\%}, \code{\%file\%}, and \code{\%column\%}
}
}
\item{backend}{
character: currently, \code{csv} and \code{monetdb} are supported
}
}
\details{
Read time-series data from csv files.
......
......@@ -7,7 +7,7 @@
Write time-series data to files.
}
\usage{
write_ts_table(x, dir, file, add = FALSE, overwrite = FALSE)
write_ts_table(x, dir, file, add = FALSE, overwrite = FALSE, backend = "csv")
}
\arguments{
\item{x}{
......@@ -27,7 +27,11 @@ write_ts_table(x, dir, file, add = FALSE, overwrite = FALSE)
}
\item{overwrite}{
logical: overwrite existing file when data differs
}
}
\item{backend}{
character: currently, \code{csv} and \code{monetdb} are supported
}
}
\details{
Write files.
......@@ -44,6 +48,5 @@ write_ts_table(x, dir, file, add = FALSE, overwrite = FALSE)
\examples{
\dontrun{
write_ts_table(ts_table(1, Sys.Date(), "a_column"),
dir = "~/tsdb/daily", file = "example")
}
dir = "~/tsdb/daily", file = "example")}
}
\ No newline at end of file
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