Try to perform struct method but coreced to R-typed object
renkun-ken opened this issue · 2 comments
renkun-ken commented
Some types of objects created by CLR are by default coerced to R-typed objects. For example,
library("rClr")
dt1 <- clrNew("System.DateTime", year = 2015L, month = 12L, day = 10L)
dt1
will be a POSIXct
object in R. How can I call System.DateTime.AddDays
method to the original object?
Kevin-Jin commented
+1, I'm having problems with this as well. In my case, I want to call DateTime().ToOADate() like so
clrCall(Sys.Date(), "ToOADate")
jmp75 commented
DateTime objects are indeed converted to R constructs, on purpose. A possible workaround is to create a wrapper class around DateTime (or a set of static methods with DateTime parameters).
I take note of the need to have more convenient ways to have the option to convert .NET objects or not to R, but the use case is broader and need to be elicited further.