Hi #rstats friends, How can I install an R function as a shell🐚command system-wide? To be clear, I want to install my R®️package📦& run a function without using its path or Rscript. For example, $ myRfunction shell_argument Is this possible or should I make a CLI with #Python🐍?
3
3
1
5
There is also littler from Dirk @eddelbuettel. Check out the examples
1
3
Interesting, this is a great example of what I want to do. > install.packages("mypkg") $ myshellcmd arg Hi @eddelbuettel, it looks like littler uses C's getopt to provide the shell interface. Do you have some advice on how to set this up? Is there a blog post or tutorial? Thanks!
1
Thanks Dirk! I installed littler. I found the r executable in srv/rlibs/littler/bin. How can I set up an R package to install a shell wrapper, an R script, or a binary in .../bin so anyone use my R code as a shell command? I'm looking at @hadleywickham's r-pkgs.had.co.nz/src.html#cp…
1
It seems you already answered my question here: stackoverflow.com/questions/… So, to install an executable as part of an R package I need to write the executable in C and compile it. Do you have any advice or resources on how to set up an R package to install a binary (like r)? Thanks!
1