TSdbiMethods {TSfame}R Documentation

TSdbi fame Methods

Description

Methods for TSdbi fame time series dtabase connection.

Usage

    ## S4 method for signature 'fameDriver, character':
    TSconnect(drv, dbname, accessMode = if (file.exists(dbname))
                 "shared" else "create", ...)
    ## S4 method for signature 'character,
    ##	 TSfameConnection':
    TSget(serIDs, con, TSrepresentation =
                 getOption("TSrepresentation"), tf = NULL, start =
                 tfstart(tf), end = tfend(tf), names = serIDs,
                 TSdescription = FALSE, TSdoc = FALSE, TSlabel=FALSE,   ...)
    ## S4 method for signature 'ANY, character,
    ##	 TSfameConnection':
    TSput(x, serIDs=seriesNames(x),
        con, TSdescription.=TSdescription(x), TSdoc.=TSdoc(x), TSlabel.=NULL,
        warn = TRUE, ...)
    ## S4 method for signature 'character,
    ##	 TSfameConnection':
    TSdates(serIDs, con, ...)
    ## S4 method for signature 'character,
    ##	 TSfameConnection':
    TSexists(serIDs, con, ...)
    ## S4 method for signature 'character,
    ##	 TSfameConnection':
    TSdelete(serIDs, con, ...)
    ## S4 method for signature 'character,
    ##	 TSfameConnection':
    TSdescription(x, con, ...)
    ## S4 method for signature 'character,
    ##	 TSfameConnection':
    TSdoc(x, con, ...)
    ## S4 method for signature 'character,
    ##	 TSfameConnection':
    TSlabel(x, con, ...)

    ## S4 method for signature 'TSfameConnection':
    dbDisconnect(conn,...)
    ## S4 method for signature 'fameDriver':
    dbUnloadDriver(drv, ...)

    ## Default S3 method:
    fame()

Arguments

drv A fameDriver.
dbname A character string indicating a database name.
con A database connection.
conn A database connection.
serIDs identifiers for series to extract.
x data series to put on the database, or a series identifier for TSdescription and TSdoc or, for print, a database connection as returned by TSconnect.
TSrepresentation time series representation to use for the result.
names Optional character vector to use for series names.
tf Optional tframe to use for truncating data. (See tfwindow.)
start Optional start date to use for truncating data. (See tfwindow.)
end Optional end date to use for truncating data. (See tfwindow.)
TSdescription TRUE or FALSE indicating whether description should be extracted
TSdescription. Description to put on the database.
TSdoc TRUE or FALSE indicating whether documentation should be extracted.
TSdoc. Documentation to put on the database.
TSlabel For compatibility with other TS packages. Not supported in Fame
TSlabel. For compatibility with other TS packages. Not supported in Fame
warn Logical indicating if warning messages should be suppressed.
accessMode Optional character indicating the mode to use when opening the Fame database when establishing the first connection. After the first connection, "read" will be used for reading and "update" for writing.
... Arguments passed to other methods.

Details

These are fame methods for TSdbi. See the package TSdbi for details and see the vignette distributed with this package for more complete examples.

Value

depends.

See Also

TSdbi-package, dbConnect, TSput sqlQuery

Examples

    con <- try(TSconnect(dbDriver("fame"), dbname="test.db"))
    if(! inherits(con, "try-error")) {
      z <- ts(rnorm(100), start=c(1975,1), frequency=12)
      seriesNames(z) <- "random1"
      if(TSexists("random1", con)) TSreplace(z, con) else
      TSput(z, con)
      z1 <- TSget("random1", con)
      tfplot(z1)
      z <- ts(matrix(rnorm(100),50,2), start=c(1975,1), frequency=4)
      seriesNames(z) <- c("random2","random3")
      if(TSexists("random2", con) |
         TSexists("random3", con) ) TSreplace(z, con) else
      TSput(z, con)
      z2 <- TSget("random2", con)
      tfplot(z2)
      TSdates("D1", con)
      TSdates("random2", con)
      TSdates(c("random1","random2","random3"), con)
      TSmeta("random2", con)
      options(TSconnection=con)
      z2 <- TSget(c("random2","random3"))
      z <- TSdates(c("D1","random2","random3"))
      print(z)
      TSmeta("random2")
      TSdelete("random1", con)
      TSdelete("random2")
      dbDisconnect(con)
      }

[Package TSfame version 2009.3-1 Index]