0

New to R programming so bear with me.

I am trying to call a function defined in a cpp file inside the RDCOMClient package called R_convertDCOMObjectToR. I did not write that package - it's available here: https://github.com/omegahat/RDCOMClient

I try to call it like this:

.Call("R_convertDCOMObjectToR", varQuestionNames, PACKAGE = "RDCOMClient")

But I get the following error:

Error in .Call("R_convertDCOMObjectToR", varQuestionNames, PACKAGE = "RDCOMClient") : "R_convertDCOMObjectToR" not available for .Call() for package "RDCOMClient"

Is there anyway to make that function visible? should I ask the author to change his library?

Thanks for any pointer!

Dirk Eddelbuettel
  • 360,940
  • 56
  • 644
  • 725
BadJerry
  • 154
  • 1
  • 12

1 Answers1

3

You simply cannot call any given C function from any given package unless that package exports it.

See Writing R Extensions, Section 5.4.3, several example usages in various packages (such as eg my RApiSerialize and RApiDatetime), and other questions here on the site.

Dirk Eddelbuettel
  • 360,940
  • 56
  • 644
  • 725
  • Thanks Dirk - I am actually reading your "Seamless R and C++ integration" and I am clearly only at the beginning. And apologies if I have wasted your time... – BadJerry Nov 07 '17 at 13:22