TSdbiMethods            package:TSSQLite            R Documentation

_T_S_d_b_i _S_Q_L_i_t_e _M_e_t_h_o_d_s

_D_e_s_c_r_i_p_t_i_o_n:

     Methods for TSdbi SQLite time series dtabase connection.

_U_s_a_g_e:

         ## S4 method for signature 'SQLiteDriver, character':
         TSconnect(drv, dbname)
         ## S4 method for signature 'character,
         ##	 SQLiteConnection':
         TSget(serIDs, con,  ...)
         ## S4 method for signature 'ANY, character,
         ##	 SQLiteConnection':
         TSput(x, serIDs, con,  ...)
         ## S4 method for signature 'character,
         ##	 SQLiteConnection':
         TSdates(serIDs, con, ...)
         ## S4 method for signature 'character,
         ##	 SQLiteConnection':
         TSdelete(serIDs, con, ...)
         ## S4 method for signature 'character,
         ##	 SQLiteConnection':
         TSdescription(x, con, ...)
         ## S4 method for signature 'character,
         ##	 SQLiteConnection':
         TSdoc(x, con, ...)
         ## S4 method for signature 'TSSQLiteConnection':
         print(x, ...)

_A_r_g_u_m_e_n_t_s:

     drv: A SQLiteDriver.

  dbname: A character string indicating a database name.

     con: 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.

     ...: Arguments passed to other methods.

_D_e_t_a_i_l_s:

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

_V_a_l_u_e:

     depends.

_S_e_e _A_l_s_o:

     'TSdbi-package', 'dbConnect', 'TSdbiPut'

_E_x_a_m_p_l_e_s:

         con <- try(TSconnect(dbDriver("SQLite"), dbname="test"))
         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")
           }
         con <- try(TSconnect(dbDriver("SQLite"), dbname="ets"))
         if(! inherits(con, "try-error")) {
           TSmeta("B103", con)
           z1 <- TSget("B103", con)
           tfplot(z1)
           z2 <- TSget(c("B103", "B104"), con)
           tfplot(z2)
           options(TSconnection=con)
           TSmeta("B103")
           z2 <- TSget(c("B103","B104"))
           TSmeta(z2)
           TSdates("D1", con)
           TSdates("B103", con)
           TSdates(c("D1","B103","B104"), con)
           z <- TSdates(c("D1","B103","B104"))
           print(z)
           start(z)
           end(z)
           }

