>na.contiguousfunction (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? -- Let's not spend our time and resources thinking about things that are so little or so large that all they really do for us is puff us up and make us feel like gods. We are mammals, and have not exhausted the annoying little problems of being mammals. -K. Mullis [[alternative HTML version deleted]]
This is a S3 method, then: methods("na.contiguous") getS3method("na.contiguous", "data.frame") getS3method("na.contiguous", "zoo") On Fri, Jul 18, 2008 at 10:37 AM, stephen sefick <ssefick at gmail.com> 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? > > -- > Let's not spend our time and resources thinking about things that are so > little or so large that all they really do for us is puff us up and make us > feel like gods. We are mammals, and have not exhausted the annoying little > problems of being mammals. > > -K. Mullis > > [[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. >-- Henrique Dallazuanna Curitiba-Paran?-Brasil 25? 25' 40" S 49? 16' 22" O
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.defaultError: 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 %~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%