From renaud at mancala.cbio.uct.ac.za  Thu Jul  5 10:38:01 2012
From: renaud at mancala.cbio.uct.ac.za (Renaud Gaujoux)
Date: Thu, 05 Jul 2012 10:38:01 +0200
Subject: [Rd] Extracting srcref for S4 methods
Message-ID: <4FF55269.3090005@cbio.uct.ac.za>

Hi,

on R version 2.15.1 (2012-06-22) (Platform: i686-pc-linux-gnu (32-bit)) 
sourced functions have srcref attached as an attribute.
Are such data also available for S4 generics and methods? How? (See 
sample code below)
Thank you.

Bests,
Renaud

f <- textConnection(
"
f <- function(){}

setGeneric('myfun', function(x, ...) standardGeneric('myfun'))

setMethod('myfun', 'numeric', function(x, ...){ 'myfun,numeric' })
")
source(f, keep.source=TRUE)

# there are srcref data for functions
str(f)
# no srcref data
str(myfun)
str(selectMethod(myfun, 'numeric'))

-- 
Renaud Gaujoux
Computational Biology - University of Cape Town
South Africa



[Rd] Extracting srcref for S4 methods
Renaud Gaujoux