[Rd] Extracting srcref for S4 methods

From: Renaud Gaujoux <renaud_at_mancala.cbio.uct.ac.za>
Date: Thu, 05 Jul 2012 10:38:01 +0200


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

______________________________________________
R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Thu 05 Jul 2012 - 08:47:27 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 05 Jul 2012 - 16:30:31 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive