I usually do a standard reprex, SO post, rinse and repeat, but this is a tough one to replicate. I'll try to describe my issue as best as possible.
Background
I'm trying to build a custom package in R which I called, simply, myTools
. The build runs with no errors, and all of the functions work (+/- a few things I need to polish up). It is just a collection of functions that I've found helpful in my line of work. I have a particular function get_data()
, which reads a CSV file and cleans it up (it is a human-readable, but completely anti-tidy dataset). The function cleans it up and makes the data tidy (imagine an Invoice turned into a tidy dataset, as an example).
Issue
Every time I compile the package, and test the function get_data()
, somehow R runs an older version of the function. I've run the lines in the function manually, one-by-one, and the result of the code has no errors and returns the expected tidy dataset. However, if I call the compiled get_data()
in the console, an older version of the function is called.
Notes
I added a simple line print("Hello Bob!")
to the function. It does not show in the output after build and install. Again, more evidence that R seems to be using some older source of my function and is compiling THAT one.
pkgbuild::find_rtools()
returns TRUE
I closed the build project, opened a fresh RStudio/R session. Loaded my library in a blank script file. Upon ctrl-click on the function get_data()
, indeed RStudio took me to an older version of the function.
Expected Results
The freshly-compiled version of get_data()
to be called in the console/script.
Any hints, ideas to try is appreciated. Thank you!