R how to view the standard general method if the object is not specified

I am trying to view the writeRaster function in a raster package:

> library("raster") > writeRaster standardGeneric for "writeRaster" defined from package "raster" function (x, filename, ...) standardGeneric("writeRaster") 

And showMethods does not show the names of objects that I can use in getMethod:

 > showMethods("writeRaster") Function: writeRaster (package raster) x="RasterLayer", filename="character" x="RasterStackBrick", filename="character" 

Where do I go from there to explicit

 > getMethod("writeRaster","RasterLayer") 

* Edit As suggested by @Metrics:

 > getAnywhere("writeRaster") A single object matching 'writeRaster' was found It was found in the following places package:raster namespace:raster with value function (x, filename, ...) standardGeneric("writeRaster") <bytecode: 0x5a78b18> <environment: 0x5acadd8> attr(,"generic") [1] "writeRaster" attr(,"generic")attr(,"package") [1] "raster" attr(,"package") [1] "raster" attr(,"group") list() attr(,"valueClass") character(0) attr(,"signature") [1] "x" "filename" attr(,"default") `\001NULL\001` attr(,"skeleton") (function (x, filename, ...) stop("invalid call in method dispatch to 'writeRaster' (no default method)", domain = NA))(x, filename, ...) attr(,"class") [1] "standardGeneric" attr(,"class")attr(,"package") [1] "methods" 
0
source share

Source: https://habr.com/ru/post/969787/


All Articles