[Rd] [R] setClass with a slot of RODBC

From: <adschai_at_optonline.net>
Date: Sun, 03 Jun 2007 00:07:45 +0000 (GMT)

attached mail follows:



Hi,

A couple of thoughts:

(1) The channel RODBC is an S3 object, thus there's no proper S4 class associated with it. From ?setOldClass: ....
Description:

     Register an old-style (a.k.a. `S3') class as a formally defined
     class. The 'Classes' argument is the character vector used as the
     'class' attribute; in particular, if there is more than one
     string,  old-style class inheritance is mimicked.  Registering via
     'setOldClass' allows S3 classes to appear  in method signatures,
     and as a slot in an S4 class if a prototype is included.
...

(2) This question may be more appropriate for r-devel?

HTH,

--
David


On 6/1/07, adschai_at_optonline.net <adschai_at_optonline.net> wrote:

> Hi - I tried to get some answer before but there seems to have no one response. My question is that I have a class like below definition:
>
> setClass("DBManager",
> representation(channel="RODBC"))
>
> My purpose of the conn slot is to hold a channel to database connection which is returned by a command like:
>
> channel <- odbcConnect("DB", uid="user", pwd="password")
>
> According to RODBC documentation, this channel is supposed to have a type of "RODBC". However, if I declare my class as above, R will complain that it does not know about "RODBC" type or class. Please clarify. 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.
>

______________________________________________ R-devel_at_r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Received on Sun 03 Jun 2007 - 00:11:00 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 Tue 05 Jun 2007 - 07:34:21 GMT.

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