[R] Building R package.

Douglas Bates bates at stat.wisc.edu
Wed Apr 16 00:03:42 CEST 2003


Eryk Wolski <wolski at molgen.mpg.de> writes:

> Hi!
> I am trying to build a package which calls an c function. It compiles
> it and installs it. But if i run R CMD check test_
> 
> the last output are:
> 
> * checking examples ... ERROR
> Running examples failed. x<-1:10
> 
> 
> and in the test-Ex.out file i find:
> > test(x)
> Error in .C("mytest", as.double(x), as.integer(lengthx)) :
>         C/Fortran function name not in load table Execution halte
> 
> 
> 
> May anyone take a look on this test please?
> 
> 
> system  "Linux"  "2.4.19-16mdk"
> R version 1.62

You probably haven't called library.dynam in a .First.lib function as
described in the "Package subdirectories" section of "Writing R
Extensions"

  "If necessary, one of these files (historically `zzz.R') should use
  `library.dynam()' _inside_ `.First.lib()' to load compiled code."

The typical contents of the file R/zzz.R in a package source directory
are

.First.lib <- function(lib, pkg) {
    library.dynam(pkg, pkg, lib)
}



More information about the R-help mailing list