[R] Newbie creating package with compiled code

Edna Bell edna.bell01 at gmail.com
Thu Jul 5 00:43:31 CEST 2007

Hi R Gurus!

I'm trying to create a test package using the package.skeleton function.
I wanted to  add some compiled code too.
In the src library, I put together a baby subroutine, compiled it and created
a test.dll

When I use the R cmd build, it works fine.  But I get into trouble
with the R CMD check section.

/home/Desktop/R-2.5.1/bin # ./R CMD check mypkg
* checking for working latex ... OK
* using log directory '/home/Desktop/R-2.5.1/bin/mypkg.Rcheck'
* using R version 2.5.1 (2007-06-27)
* checking for file 'mypkg/DESCRIPTION' ... OK
* checking extension type ... Package
* this is package 'mypkg' version '1.0'
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking whether package 'mypkg' can be installed ... OK
* checking package directory ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking R files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... ERROR
Error in .find.package(package, lib.loc, verbose = verbose) :
        there are no packages called 'mypkg', 'stats', 'graphics',
'grDevices', 'utils', 'datasets', 'methods', 'base'
Error in library(mypkg) : .First.lib failed for 'mypkg'
Execution halted

It looks like this package has a loading problem: see the messages for

Here is the mypkg.R file
sss <- "/home/hodgesse/Desktop/R-2.5.1"
.First.lib <- function(lib=sss,pkg="mypkg")

f <- function(x,y) x+y

g <-function(x,y) x-y

Thanks for any help

mailto: edna.bell01 at gmail.com

More information about the R-help mailing list