From ligges at statistik.uni-dortmund.de  Tue Jun  5 09:20:12 2007
From: ligges at statistik.uni-dortmund.de (Uwe Ligges)
Date: Tue, 05 Jun 2007 09:20:12 +0200
Subject: [Rd] setClass with a slot of RODBC
In-Reply-To: <e251dcaf2ccf6.4664bfc3@optonline.net>
References: <e34bfa562b949.46620651@optonline.net>
	<e251dcaf2ccf6.4664bfc3@optonline.net>
Message-ID: <46650EAC.1060008@statistik.uni-dortmund.de>



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:

Don't forget that "RODBC" is not an S4 but an S3 class, hence you have 
to declare it:

setOldClass("RODBC")


Uwe Ligges


> 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-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



[Rd] setClass with a slot of RODBC
Uwe Ligges