[Rd] Use of Matrix within packages in R-2.14.0

Bryan W. Lewis blewis at illposed.net
Sat Nov 12 01:12:53 CET 2011

Dear R-devel readers:

  I am really stuck trying resolving an issue with the use of the
Matrix in one of my packages, irlba, with R-2.14.0. When I use
crossprod with at least one sparse argument in the packaged code I
receive the error:

Error in crossprod(x, y) :
  requires numeric/complex matrix/vector arguments

However, when I run the code outside of the context of the package it
works fine.

I have constructed the following trivial dummy package to replicate
the problem, the contents of which follow:

Package: dummy
Type: Package
Title: Dummy package for testing
Version: 0.0.0
Date: 2011-10-15
Author: B. W. Lewis <blewis at illposed.net>
Maintainer: B. W. Lewis <blewis at illposed.net>
Description: A bogus test package
Depends: Matrix
License: GPL


R/test.R file:
`test` <- function(A)
  x = crossprod(A)

To replicate the problem, create a package called "dummy" from the
above three files, install it, and run from R-2.14.0:

A = Matrix(0,10,10)

I have tested this with Ubuntu 10.10 GNU/Linux (64-bit), and 32-bit
Windows versions of R-2.14.0.

Any help in resolving this issue is greatly appreciated!



More information about the R-devel mailing list