I have a pretty good understanding of C but very little of R. I have installed an R-package (coxme) into R-studio on Windows7 from source which included compiling several C files into a .dll. This package is not standalone and depends on at least 2 other packages (maybe more). It runs too slow so I would like to see if I can speed it up by profiling it first. I used the R-package "profvis" to profile the R-code but it only tells me that 98% of the time get used by the "coxme" package without giving any further details. The call to the R package looks something like:
frail.xg=coxme(Surv(y.vec,delta.vec)~x.mat+g.vec+(1|fiid.vec),varlist=list(K.mat))
The entire package has no function named coxme(...)
, so I have no idea what goes on after I call this package as shown above. I tagged every function inside the "src" directory of the package to print (append) to a file, but only the init()
function fires upon installation when it registers the package. Non of the other functions print to that file once I run coxme from within R-Studio. Besides the init()
function it seems that non of the C-functions in the package even get executed when I call coxme(...)
. My approach is like:
remove.packages("coxme")
manipulate C-code in coxme "src" directory to print to some external file "I am function XYZ, etc.". create coxme.tar.gz
install.packages('E:/Workdir/AOO/R/coxme/coxme.tar.gz', repos = NULL, type="source")
library("coxme")
frail.xg=coxme(Surv(y.vec,delta.vec)~x.mat+g.vec(1|fiid.vec),varlist=list(K.mat))
this produces some expected result. But non of the C-functions seem to get hit, nor does my profiling code. So my questions are:
- What exactly gets executed?
- How do I go about and find out what's eating up most of the time within the coxme package?