How to implement guide with `rcpp::sourcecpp()` not recognizing updated c++ function in r 4.3.0
I'm working through a tutorial and I need help solving I've looked through the documentation and I'm still confused about I'm working with an scenario where changes made to a C++ function in my R package are not being recognized after using `Rcpp::sourceCpp()`... I initially compiled the C++ code without any problems, but after modifying the function, calling it in R still seems to reference the old version. I've tried clearing the workspace and restarting R, but the scenario continues. Hereβs the relevant part of my code: ```cpp // my_functions.cpp #include <Rcpp.h> using namespace Rcpp; // [[Rcpp::export]] int add(int x, int y) { return x + y; } ``` After modifying the function to include a check: ```cpp // my_functions.cpp #include <Rcpp.h> using namespace Rcpp; // [[Rcpp::export]] int add(int x, int y) { if (x < 0 || y < 0) throw std::invalid_argument("Inputs must be non-negative"); return x + y; } ``` I run the following command in R: ```r Rcpp::sourceCpp("path/to/my_functions.cpp") ``` But when I call `add(-1, 2)`, I still get the old behavior without the behavior check. Iβve verified that the path is correct and that there are no lingering compiled versions in the directory. Is there something else I need to do to ensure that the updates to the C++ function are recognized? Any suggestions would be greatly appreciated! Am I missing something obvious? I recently upgraded to R stable. Any ideas what could be causing this? The stack includes R and several other technologies.