1

When an R function is typed without (), the code that makes up the function will be returned

e.g.

head
function (x, ...) 
UseMethod("head")
<bytecode: 0x0000022cd79ce9a8>
<environment: namespace:utils>

How can I do this for a function that is calling some C code?

Example

I am trying to see the (c) code that makes up the _pdftools_poppler_pdf_text function from pdftools package (which can be found by running pdftools:::poppler_pdf_text, which itself comes from the exported function pdf_text)

i.e.

pdftools:::poppler_pdf_text

Returns

function (x, opw, upw) 
{
    .Call("_pdftools_poppler_pdf_text", PACKAGE = "pdftools", 
        x, opw, upw)
}
<bytecode: 0x0000022ce8bff450>
<environment: namespace:pdftools>

How can I see the (c) code that makes up _pdftools_poppler_pdf_text ?

stevec
  • 41,291
  • 27
  • 223
  • 311
  • ```pryr::show_c_source(...)``` – M-- Jun 21 '19 at 19:44
  • 1
    https://stackoverflow.com/questions/14035506/how-to-see-the-source-code-of-r-internal-or-primitive-function or https://stackoverflow.com/questions/14035506/how-to-see-the-source-code-of-r-internal-or-primitive-function or https://stackoverflow.com/questions/19226816/how-can-i-view-the-source-code-for-a-function – M-- Jun 21 '19 at 19:46

0 Answers0