Best practices to use rCLR to develop new package

Oct 28, 2013 at 9:15 PM
Edited Oct 28, 2013 at 9:15 PM
When we use rCLr in a new package, What are the best practices to manage .net dll within The R package source code?

Here my solution :
  • I create an inst folder under my pacakge file tree.
  • I create a post build event to copy my .net dll under inst.
  • I build and rebuild my package , it will copy the dll under system.file(package='mypackage')
  • In .load I refernce my .net dll using something like
Oct 28, 2013 at 9:57 PM
I have one example of a package that depends on rClr at

It depends on a fairly large modelling framework, so it is not something that is readily compilable/runable by someone unfamiliar. It is also not really a minimalist example of a dependency on rClr, but hopefully will be useful for a few hints and ideas.
Marked as answer by agstudy on 10/31/2013 at 2:14 PM
Oct 31, 2013 at 9:03 PM
Edited Oct 31, 2013 at 9:04 PM

This is definitely helping me to organize my package. I think I will write a HOWTO to present how to write package using RClr.

I have a question concerning :

I am using this command :
-cp -p -u -@cp -u -p $(MYPACKGE_BINs) $(INSTDIR)/libs` To copy .dll under inst/libs.

Does this command work for you? For some reason I lose rights when I copy from src to inst and then R CMD install fail to copy

the .dll to the directory where the package is installed. For the moment I ma using the post build event as a workaround.