hh1985
hh1985

Reputation: 21

rClr pass by reference

I am using rClr package in R to extract methods from third-party dll. I have following error in my code.

> clrGetMemberSignature(ch, 'getTimeIntensityPairs')
[1] "Method: Void getTimeIntensityPairs, TimeIntensityPairList&"

> ch_data <- clrNew('pwiz.CLI.msdata.TimeIntensityPairList')

> ch_data
An object of class "cobjRef"
Slot "clrobj":
<pointer: 0x0000000030d9d860>
Slot "clrtype":
[1] "pwiz.CLI.msdata.TimeIntensityPairList"

> clrCall(ch, 'getTimeIntensityPairs', ch_data)
Error in clrCall(ch, "getTimeIntensityPairs", ch_data) : 
  Type:    System.MissingMethodException
Message: Could not find a suitable instance method getTimeIntensityPairs on type pwiz.CLI.msdata.Chromatogram for method parameters TimeIntensityPairList
Method:  Void ThrowMissingMethod(System.Type, System.String, System.String, System.Type[])
Stack trace:
at Rclr.ReflectionHelper.ThrowMissingMethod(Type classType, String methodName, String modifier, Type[] types) in c:\Users\hhusl\AppData\Local\Temp\RtmpWMoV35\R.INSTALL337439456109\rClr\src\ClrFacade\ReflectionHelper.cs:line 785
at Rclr.ClrFacade.InternalCallInstanceMethod(Object obj, String methodName, Boolean tryUseConverter

So ch has a method: void getTimeIntensityPairs(TimeIntensityPairList&). With rClr, I was able to construct obj of TimeIntensityPairList type (ch_data in my case), but how can I generate the referenced version TimeIntensityPairList& and let it pass the type checking?

Upvotes: 2

Views: 150

Answers (0)

Related Questions