Displaying 2 results from an estimated 2 matches for "tsconnection".
Did you mean:
sconnection
2007 Jul 16
1
S4 coerce
...m, dbname="test")
> dbGetQuery(con, "create table zzz (
+ vintage VARCHAR(20) NOT NULL,
+ alias VARCHAR(20) default NULL,
+ Documentation TEXT,
+ PRIMARY KEY (vintage)
+ );")
NULL
> dbListTables(con)
[1] "zzz"
> setClass("TSconnection", representation(con="DBIConnection",
+ vintage = "logical",
+ panel = "logical")
+ )
[1] "TSconnection"
> setAs("TSconnection", "DBIConnection", def = function(from) from at con)
> setIs("TSconnection", &...
2010 May 14
1
S4 default/missing args
...to do that in S4 as shown by
this simplified example:
setGeneric("TSdoc",
def= function(x, con, ...) standardGeneric("TSdoc"))
setMethod("TSdoc", signature(x="character", con="missing"),
definition= function(x, con=getOption("TSconnection"), ...){
if(is.null(con))
stop("con should be specified or set with
options(TSconnection=con).")
else return('ok')} )
Then when I try
TSdoc("B103")
In my original problem I got
Error in is.null(con) : 'con' is missi...