Quantcast
Channel: R.NET
Viewing all articles
Browse latest Browse all 1634

New Post: .Call using R.Net

$
0
0
Hi group,

I am using R.Net to load a dll file which I have created for a C code compiled using R CMD SHLIB. It has a function which I can acess in R using the .Call() method.
But when i run the code using R.Net i get AccessViolationException as follows,

System.AccessViolationException was unhandled
Message=Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Source=R.NET
StackTrace:
   at RDotNet.Internals.DirectNativeMethods._R_tryEval(IntPtr statement, IntPtr environment, Boolean& errorOccurred)
   at RDotNet.Internals.DirectNativeMethods.R_tryEval(IntPtr statement, IntPtr environment, Boolean& errorOccurred)
   at RDotNet.Expression.TryEvaluate(Environment environment, SymbolicExpression& result)
   at RDotNet.REngine.Parse(String statement, StringBuilder incompleteStatement)
   at RDotNet.REngine.<Evaluate>d__0.MoveNext()
   at System.Linq.Enumerable.LastOrDefault[TSource](IEnumerable`1 source)
   at RDotNet.REngine.EagerEvaluate(String statement)
   at RdotNet.Program.Main(String[] args) in c:\users\user.name\documents\visual studio 2010\Projects\RdotNet\RdotNet\Program.cs:line 41
   at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
   at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
   at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()
But when i run the same DLL in R it works fine without any problem.
So i just want to know is .Call() supported in R.Net, if yes ,can anyone please give a simple example for this.

Viewing all articles
Browse latest Browse all 1634

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>