0

I'm trying to view the writeRaster function in the raster package:

> library("raster")
> writeRaster
standardGeneric for "writeRaster" defined from package "raster"

function (x, filename, ...) 
standardGeneric("writeRaster")

And showMethods doesn't show the object names 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 griven that the obvious

> 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"
cmbarbu
  • 4,354
  • 25
  • 45
  • 1
    `getAnywhere("writeRaster")`? – Metrics Mar 12 '15 at 21:49
  • `getMethod("writeRaster", signature=c("RasterLayer", "character")) `. http://stackoverflow.com/questions/12679941/show-source-code-for-a-function-in-a-package-in-r – user20650 Mar 12 '15 at 22:24
  • 1
    @user20650 Thanks I addn't seen that question/answer and the possibility to put several tags in a signature. – cmbarbu Mar 12 '15 at 22:29

0 Answers0