On Fri, 2008-07-18 at 09:37 -0400, stephen sefick wrote: > >na.contiguous > function (object, ...) > UseMethod("na.contiguous") > <environment: namespace:stats> > > this is what I get when I look for the source code for some functions- Is > there a way to look at the source code?
na.contiguous is an S3 generic function, and that *is* the source for it! To see what methods are available, used methods(): > methods(na.contiguous) [1] na.contiguous.default* Non-visible functions are asterisked To see the code in the available method, you need to access it in the relevant namespace as it is hidden from the user: > na.contiguous.default Error: object "na.contiguous.default" not found > getAnywhere(na.contiguous.default) A single object matching ‘na.contiguous.default’ was found It was found in the following places registered S3 method for na.contiguous from namespace stats namespace:stats with value function (object, ...) { ...snip... ?UseMethod would have got you there. See Uwe Ligges RNews article on this very subject: http://cran.r-project.org/doc/Rnews/Rnews_2006-4.pdf HTH G -- %~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~% Dr. Gavin Simpson [t] +44 (0)20 7679 0522 ECRC, UCL Geography, [f] +44 (0)20 7679 0565 Pearson Building, [e] gavin.simpsonATNOSPAMucl.ac.uk Gower Street, London [w] http://www.ucl.ac.uk/~ucfagls/ UK. WC1E 6BT. [w] http://www.freshwaters.org.uk %~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~% ______________________________________________ R-help@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.