[R] Suppressing "creating new generic" and "expanding the signature" messages

Yi, Derek Derek.Yi at FMR.COM
Mon Jul 15 18:18:10 CEST 2002


Hi all,

I am building a R package which defines a class.  I have overloaded methods
for this class using setMethod, and now, when I require my package, I get
diagnostic messages.

setMethod("[", signature(x = "portfolio"),
	function(x, i, j, ...) {
		# ...
	})

> require(portfolio)
Loading required package: portfolio 
[... loading other required packages ...]
Creating a new generic function for "as.data.frame" on element 1 of the
search path 
Expanding the signature to include omitted arguments in definition: drop =
"missing" 
Creating a new generic function for "summary" on element 1 of the search
path 
[1] TRUE

I realize that the messages tell me that the generic functions have been
expanded to accommodate new objects, but is there any way to suppress them?
Also, I have been trying to overload the [] operators for my object, with
limited success.  I have declared an as.data.frame function, and then have
been trying to use [.data.frame on the coerced object.  Everything works,
but I get the omitted arguments message.  My function "prototype" is above;
is there any way to avoid this?

I guess my fundamental vagueness comes from my uncertainty as to how the
"drop" argument can be handled, if I only want to pass arguments directly
into [.data.frame.  I run into "missing" arguments problems:

> args("[.data.frame")
function (x, i, j, drop = if (missing(i)) TRUE else length(cols) == 
    1) 
NULL

Many thanks,
Derek

> R.version
         _                   
platform sparc-sun-solaris2.6
arch     sparc               
os       solaris2.6          
system   sparc, solaris2.6   
status                       
major    1                   
minor    5.1                 
year     2002                
month    06                  
day      17                  
language R     
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list