[R] forcing evaluation of a char string argument

rballen rballentine at gmail.com
Wed Dec 22 23:42:22 CET 2010

I'm trying to make a function to turn a regular function into an S3 generic
one. I want myMethod to be:

function(x,...) UseMethod("myMethod")

But I keep getting:

function(x,...) UseMethod(func)

Here's the function: 

toGeneric<-function(func) {
	# default method of new generic = the original function  
	assign(func,function(x,...) UseMethod(func),pos=env)


I messed around with force, substitute, and deparse, but I can't get any of
those to help.

View this message in context: http://r.789695.n4.nabble.com/forcing-evaluation-of-a-char-string-argument-tp3161365p3161365.html
Sent from the R help mailing list archive at Nabble.com.

More information about the R-help mailing list