Almost perfect, but how to unload Rclr Objects in R

May 30, 2014 at 1:05 PM
Rclr is a great tool. And it works like a charm!

In my case for example, I am using the code below to create an object in R that comes as a compiled .Net-Visual-Basic exe.
library(rClr)
clrLoadAssembly("C:/.../.../example.exe")
MyObject = clrNew("example.abc")
It works perfect and I could use all the functions the exe provides.

But there is one Problem. I can't create a new object of the same type. When I run
MyObject = clrNew("example.abc")
again, to overwrite the old object with a new one, or if I run
My_New_Object = clrNew("example.abc")
to create a new object of the same type it fails. There is no error message but I can't access functions of the exe anymore. I thought I would maybe have to unload the object before creating a new one:
rm(MyObject )
MyObject = clrNew("example.abc")
But that does not change anything.

Let me finish with saying thanks again for this nice tool!
May 30, 2014 at 1:40 PM
One Workaround is to unload the complete rClr package with
detach("package:rClr", unload=TRUE)
and then recreate everything again. But I guess there is a better way that I am too stupid to find ;-)