[R] (no subject)

From: wei sun <sunwei_at_stat.ucla.edu>
Date: Fri 23 Dec 2005 - 10:33:34 EST


Hi,

I am new in writing R extension.
I read the "Writing R Extensions", and search online but just cannot find the answer.

I am trying to add c-code, which depend on GSL C library, into my R package.
I am using Max OS-X 10.4.3, powerpc-apple-darwin8-gcc-4.0.1

I begin wtih package.skeleton, and then add my c file into folder src and then add file Makevars:

PKG_LIBS=-lgsl -lgslcblas -lm

In the zzz.R file, I add the function .First.lib:

.First.lib <- function(lib, pkg) {

   library.dynam("anovaGSL", pkg, lib)
}

I think these two things are enough. then I just run R CMD check anovaGSL (my package name)
followed is the error message:

Error: .First.lib failed for 'anovaGSL'
Call sequence:
2: stop(gettextf(".First.lib failed for '%s'", libraryPkgName(package)),

        domain = NA)
1: library(package, lib.loc = lib.loc, character.only = TRUE, verbose = FALSE)
Execution halted
See section 'Generic functions and methods' of the 'Writing R Extensions'
manual.
* checking replacement functions ... WARNING
Error: .First.lib failed for 'anovaGSL'
Call sequence:
2: stop(gettextf(".First.lib failed for '%s'", libraryPkgName(package)),

        domain = NA)
1: library(package, lib.loc = lib.loc, character.only = TRUE, verbose = FALSE)
Execution halted
In R, the argument of a replacement function which corresponds to the right
hand side must be named 'value'.
* checking foreign function calls ... WARNING
Error: .First.lib failed for 'anovaGSL'
Call sequence:
2: stop(gettextf(".First.lib failed for '%s'", libraryPkgName(package)),

        domain = NA)
1: library(package, lib.loc = lib.loc, character.only = TRUE, verbose = FALSE)
Execution halted
See section 'System and foreign language interfaces' of the 'Writing R Extensions' manual.
* checking Rd files ... OK

appreciate any help!!!

wei

        [[alternative HTML version deleted]]



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Fri Dec 23 10:40:45 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:41:40 EST