On Nov 11, 2011 6:13 PM, "Bryan W. Lewis" <blewis@illposed.net> wrote:
">
> 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
You must create a NAMESPACE file and import the crossprod function from the
Matrix package.

> 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:
>
> DESCRIPTION file:
> Package: dummy
> Type: Package
> Title: Dummy package for testing
> Version: 0.0.0
> Date: 2011-10-15
> Author: B. W. Lewis <blewis@illposed.net>
> Maintainer: B. W. Lewis <blewis@illposed.net>
> Description: A bogus test package
> Depends: Matrix
> License: GPL
>
> NAMESPACE file:
> export("test")
>
> R/test.R file:
> `test` <- function(A)
> {
>  x = crossprod(A)
>  return(0)
> }
>
>
> To replicate the problem, create a package called "dummy" from the
> above three files, install it, and run from R-2.14.0:
>
> library("dummy")
> A = Matrix(0,10,10)
> test(A)
>
> 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!
>
> Thanks,
>
> Bryan
>
> ______________________________________________
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

	[[alternative HTML version deleted]]

