r-lib / cpp11

cpp11 helps you to interact with R objects using C++ code.
https://cpp11.r-lib.org/
Other
193 stars 46 forks source link

Update README.md with note on imports #316

Closed pepijn-devries closed 1 year ago

pepijn-devries commented 1 year ago

When using functions from other packages using the cpp11 package function, I noticed that when calling such functions R would get stuck and doesn't throw errors or warnings. It took me a while to realise that these functions weren't imported to the namespace. After importing the functions, everything worked smoothly. I've added this note to help others avoid running into the same problem.

romainfrancois commented 1 year ago

Thanks for the contribution. I feel that this is a little too specific for a README. Perhaps we can instead do something here to error when the namespace is not found:

https://github.com/r-lib/cpp11/blob/3c36f7f48a4998c0cd0abb2fc964b24393eafe21/inst/include/cpp11/function.hpp#L72

with a clear error message, and some instructions on how to proceed.

pepijn-devries commented 1 year ago

Thanks for the response. Yes an error-message will definitely help here.