![]() ![]() The line in the above output indicates that the function is byte-compiled, and you can still view the source from the R command line.įunctions that call. ![]() Note that "compiled" does not refer to byte-compiled R code as created by the compiler package. You can view the source code of unexported functions by using the ::: operator or getAnywhere. makeNamesTs are unexported functions from the stats namespace. # No method found for function "extract" and signature SpatialPolygons #Error in getMethod("extract", signature = "SpatialPolygons") : It will not suffice to supply the partial signature getMethod("extract",signature="SpatialPolygons") getMethod("extract", signature = c( x = "Raster", y = "SpatialPolygons") ) To see the source code for one of these methods the entire signature must be supplied, e.g. There are also methods with more complex signatures for each method, for example require(raster) GetMethod can be used to see the source code of one of the methods: > getMethod("chol2inv", "diagonalMatrix") The method to see defined S4 methods is offered helpfully: > showMethods(chol2inv) standardGeneric is an indicator of an S4 function. The output already offers a lot of information. Use showMethods("chol2inv") for currently available ones. StandardGeneric for "chol2inv" defined from package "base" Here is an example of an S4 function: > library(Matrix) The S4 system is a newer method dispatch system and is an alternative to the S3 system. Registered S3 method for t from namespace stats print.ts time.ts* [ getAnywhere(t.ts)Ī single object matching ‘t.ts’ was found ![]() monthplot.ts* na.omit.ts* Ops.ts* plot.ts diffinv.ts* diff.ts kernapply.ts* lines.ts The S3 method dispatch systemįor S3 classes, you can use the methods function to list the methods for a particular generic function or class. UseMethod("t") is telling you that t() is a ( S3) generic function that has methods for different object classes. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |