[R] C function name garbled

Duncan Murdoch murdoch at stats.uwo.ca
Tue Sep 7 22:57:57 CEST 2004

On Tue, 7 Sep 2004 12:46:55 -0700, S Blay <sblay at sfu.ca> wrote :

>I wrote an R wrapper function (phylpro) around a C function 
>The first time I'm running my function, it runs with no errors.
>The second time I'm trying to run it, I get an error message 
>with the first argument to .Call garbled.
>Set up:
>> dyn.load("Phylpro.so")
>> source("phylpro.R")
>> WinHalfWidth<-30
>> permReps<-10
>> breaks<-c(548, 735, 832)
>First call to phylpro succeeds:
>> b<-phylpro("simulinfile", breaks, WinHalfWidth, permReps)
>Second call to phylpro fails:
>> b<-phylpro("simulinfile", breaks, WinHalfWidth, permReps)
>Error in .Call("PSg\bBh\b", input_file = 
>as.character(input_file), breaks = as.integer(breaks),  : 
>        .Call function name not in load table
>Check if my C function name is in load table: 
>> is.loaded("Rphylpro")
>[1] TRUE
>Any ideas?

It looks to me as though your function is doing something to mess up
R's internal data.  I'd try commenting out the whole body of the
function, then adding it back gradually to find which part causes the

Duncan Murdoch

More information about the R-help mailing list