[R] How to assign RODBC object as R class slots and method signature

From: <adschai_at_optonline.net>
Date: Sat, 26 May 2007 19:20:25 +0000 (GMT)

HiI have a class which would like to hold a connection to ODBC data connection. The handle to the connection is something like (according to RODBC manual):channel = odbcConnect("DSN",uid="user",pwd="password")However, I would like to make a slot of my "foo" class to hold this object. For example:setClass("foo", representation(channel="RODBC"))But this won't compile as it keeps saying that it cannot find "RODBC" as a valid class name even I have the package loaded in place. And from what I found in RODBC manual, the 'channel' variable should be of type 'RODBC'. This makes it even more difficult when I try define this database connection like 'channel' above as method signature.For example, I have a class for method like this.setMethod("setConn", "foo",   signature(object="foo",newconn="RODBC")   function(object, newconn) {   ... do something here.   })This doesn't compile. It will keep saying that it doesn't know about type "RODBC". Please let me know how we can solve this? Thank you.- adschai

        [[alternative HTML version deleted]]

R-help_at_stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Sat 26 May 2007 - 19:34:44 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sat 26 May 2007 - 20:34:17 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.