When creating a Python package, you can create "commands" by using the entry_points
argument of setup
(see here). I am wondering if it is possible to do the same when creating an R package.
For example, after running
install.packages("mypackage")
it would be nice to be able to use
mypackage_clitool arg1 arg2
without needing to use Rscript. Is it possible to have an entry point like this in an R package?
I couldn't find the answer anywhere, but for reference, here are some resources that partially address this topic:
Answer about turning a CLI into an R package - the opposite direction
CLI library - I couldn't find any instructions for installing via a package here