I have a theory that the function RPostgreSQL::dbWritetable
converts POSIXct
dates to character before writing them. I am trying to see the source code to confirm this, and despite looking at the following links I am unable to find it. In fact, I do not even know whether what I am looking at is an S3 or S4 method:
show source code for function in R
How can I view the source code for a function?
How do I show the source code of an S4 function in a package?
Firstly, I have the results of RPostgreSQL::dbWriteTable
:
nonstandardGenericFunction for "dbWriteTable" defined from package "DBI"
defined with value class: "logical"
function (conn, name, value, ...)
{
ans <- {
standardGeneric("dbWriteTable")
}
.valueClassTest(ans, "logical", "dbWriteTable")
}
<environment: 0x00000000122305e8>
Methods may be defined for arguments: conn, name, value
Use showMethods("dbWriteTable") for currently available ones.
The next step seems straightfoward:
> showMethods("dbWriteTable")
Function: dbWriteTable (package DBI)
conn="PostgreSQLConnection", name="character", value="character"
conn="PostgreSQLConnection", name="character", value="data.frame"
This doesn't give me any clues on what to do further. Running getAnwhere
:
> getAnywhere("dbWriteTable")
A single object matching ‘dbWriteTable’ was found
It was found in the following places
package:RPostgreSQL
package:DBI
namespace:DBI
with value
function (conn, name, value, ...)
{
ans <- {
standardGeneric("dbWriteTable")
}
.valueClassTest(ans, "logical", "dbWriteTable")
}
<environment: 0x00000000122305e8>
attr(,"generic")
[1] "dbWriteTable"
attr(,"generic")attr(,"package")
[1] "DBI"
attr(,"package")
[1] "DBI"
attr(,"group")
list()
attr(,"valueClass")
[1] "logical"
attr(,"signature")
[1] "conn" "name" "value"
attr(,"default")
`\001NULL\001`
attr(,"skeleton")
(function (conn, name, value, ...)
stop("invalid call in method dispatch to 'dbWriteTable' (no default method)",
domain = NA))(conn, name, value, ...)
attr(,"class")
[1] "nonstandardGenericFunction"
attr(,"class")attr(,"package")
[1] "methods"
But as there is no object = ...
output I have no idea how to use getMethod.