Use of Matrix within packages in R-2.14.0

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Use of Matrix within packages in R-2.14.0

Bryan W. Lewis-2
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:

DESCRIPTION file:
Package: dummy
Type: Package
Title: Dummy package for testing
Version: 0.0.0
Date: 2011-10-15
Author: B. W. Lewis <[hidden email]>
Maintainer: B. W. Lewis <[hidden email]>
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

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: Use of Matrix within packages in R-2.14.0

Douglas Bates-2
On Nov 11, 2011 6:13 PM, "Bryan W. Lewis" <[hidden email]> 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 <[hidden email]>
> Maintainer: B. W. Lewis <[hidden email]>
> 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
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel