[R] fix()ing an S4 method

Uwe Ligges ligges at statistik.tu-dortmund.de
Thu Jul 29 17:04:11 CEST 2010


No, I'd recommend to work with the sources directly, or if you really 
want to do it from command line, you can access with ?getMethod

Uwe Ligges

On 21.07.2010 14:36, Albert-Jan Roskam wrote:
> Hi R experts,
>
> The fix() function canbe used to edit normal functions. I would like to know whether it's also possible to use something similar to edit a method of an S4 class. In other words, is there a fix-like function that allows me to edit method definitions without having to go back to the source code?
>
> setGeneric (name="doStuff",def = function(object){standardGeneric("doStuff")})
> setClass("SomeClass", representation(text = "character"))
> setMethod(f = "doStuff", signature ("SomeClass"), definition = function(object){
>      return(print(paste("***", object at text)))  })
> fix(doStuff) # Does NOT give the intended result. How can I make R show the method definition?
>
> Cheers!!
> Albert-Jan
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> All right, but apart from the sanitation, the medicine, education, wine, public order, irrigation, roads, a fresh water system, and public health, what have the Romans ever done for us?
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
>
>
> 	[[alternative HTML version deleted]]
>
>
>
>
> ______________________________________________
> R-help at r-project.org 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.



More information about the R-help mailing list