Re: [R-pkg-devel] Error creating union class: object ‘.__C__compMatrix’ not found

2020-05-18 Thread renozao
So I can't use neither use the the class mMatrix form Matrix in my package, 
neither define an internal union class of ("Matrix", "matrix").
If I define a union class with a different name, then I have to import the 
class "Matrix" from Matrix or I get a check error.
But then I need to add Matrix as Depends (or I get an error, which makes sense).
The issue is that if I add Matrix as Depends I get the error that the package 
"Matrix" is not found, when checking if the package can be installed.
This error does not happen when installing with R CMD INSTALL.

I eventually managed to reproduce the error: as soon as I add ggplot2 in 
Imports I get the error.
A DESCRIPTION file with this breaks:

Depends:
  Matrix
Imports:
  ggplot2


I have Matrix 1.2.18 and ggplot2 3.3.0





Sent with ProtonMail Secure Email.

‐‐‐ Original Message ‐‐‐
On Monday, May 18, 2020 2:31 PM, Duncan Murdoch  
wrote:

> On 29/04/2020 1:16 p.m., renozao wrote:
>
> > Thank you Martin,
> > Looks like the mMatrix class defined in Matrix is not exported in 3.6.3, 
> > maybe it is now exported in the current R-devel.
>
> Matrix doesn't have the same versions as R: it's a recommended package,
> not a base package. It can be updated independently of R. The current
> version on CRAN is 1.2-18, but the R-forge version is 1.3-0. Neither
> one exports mMatrix.
>
> Duncan Murdoch
>
> > In this case I'd rather use a conditional import and definition.
> > I'll try that route.
> > Bests,
> > Renaud
> > Sent with ProtonMail Secure Email.
> > ‐‐‐ Original Message ‐‐‐
> > On Saturday, April 18, 2020 12:36 PM, Martin Maechler 
> > maech...@stat.math.ethz.ch wrote:
> >
> > > > > > > > renozao
> > > > > > > > on Wed, 8 Apr 2020 16:19:59 + writes:
> > >
> > > > Thank you William for the reproducible example.
> > >
> > >  > Currently I using the following (same as in William's example):
> > >
> > >  > setClassUnion("mMatrix", c("Matrix", "matrix"))
> > >
> > >
> > > > Martin, are the changes made in the union class handling affecting the 
> > > > way we should declare them?
> > >
> > > > Thank you.
> > >
> > > > Bests,
> > >
> > >  > Renaud
> > >
> > >
> > > Thank you, Renaud, and Bill Dunlap.
> > > There is obviously a bit of a problem there, but it may well be
> > > "only" a problem in error handling.
> > > As Bill's trace(get, ..) shows, R tries to get
> > > "#HAS_DUPLICATE_CLASS_NAMES" which is indeed an indication of the problem:
> > > You are trying to REdefine a class union that already exists
> > > identically in the Matrix package:
> > > In the R-forge development version of 'Matrix', it is
> > > line 717 of Matrix/R/AllClass.R (and that will be close also
> > > in the CRAN version of Matrix).
> > > So at least for you, Renaud, the solution to the problem is easy:
> > > Just don't do what you should not do: What you want is already
> > > part of Matrix and after searching: It's been part of
> > > Matrix since ca. July 2012 ...
> > >
> > > But yes, there's a buglet in the 'methods' package currently,
> > > which leads to a misleading error message
> > > (It's arguable if it should give an error which it did not previously;
> > > I think it would be quite a good idea to give at least a
> > > warning as you are masking class definition of the Matrix
> > > package which is in your search() path or at least among the
> > > loaded namespaces at this time).
> > > Best,
> > > Martin
> > >
> > > > ‐‐‐ Original Message ‐‐‐
> > >
> > >  > On Wednesday, April 8, 2020 11:19 AM, William Dunlap 
> > >  wrote:
> > >
> > >
> > > > > Use trace() to get a bit more detail - .__C_compMatrix is looked for 
> > > > > in the wrong environment with inherits=FALSE.
> > >
> > >  >>
> > >
> > >  >>> setClassUnion("mMatrix", c("Matrix", "matrix"))
> > >
> > >  >> Tracing get(name, envir = env) on entry
> > >
> > >  >> x=".AllMTable", envir="", 
> > > topenv="", inherits=TRUE
> > >
> > >  >> Tracing get(name, envir = env) on entry
> > >
> > >  >> x=".MTabl

Re: [R-pkg-devel] Error creating union class: object ‘.__C__compMatrix’ not found

2020-05-18 Thread renozao
Hi,

I tried to solve the issue in multiple ways, but I keep getting an installation 
error when running R CMD check, although the package installs fine with R CMD 
INSTALL:

Error: package ‘Matrix’ required by ‘NMF’ could not be found

I clearly have the package Matrix installed and up-to-date.
I tried with/without Matrix in Depends, with/without importing it all in the 
NAMESPACE.
Do I need to have a statement like this in the NAMESPACE:

importClassesFrom(Matrix,mMatrix)


The class appears not to be exported.
Puzzled.

Thank you.

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] Error creating union class: object ‘.__C__compMatrix’ not found

2020-04-29 Thread renozao
Thank you Martin,

Looks like the mMatrix class defined in Matrix is not exported in 3.6.3, maybe 
it is now exported in the current R-devel.

In this case I'd rather use a conditional import and definition.
I'll try that route.

Bests,
Renaud

Sent with ProtonMail Secure Email.

‐‐‐ Original Message ‐‐‐
On Saturday, April 18, 2020 12:36 PM, Martin Maechler 
 wrote:

> > > > > > renozao
> > > > > > on Wed, 8 Apr 2020 16:19:59 + writes:
>
> > Thank you William for the reproducible example.
>
> > Currently I using the following (same as in William's example):
>
> > setClassUnion("mMatrix", c("Matrix", "matrix"))
>
>
> > Martin, are the changes made in the union class handling affecting the way 
> > we should declare them?
>
> > Thank you.
>
> > Bests,
>
> > Renaud
>
>
> Thank you, Renaud, and Bill Dunlap.
>
> There is obviously a bit of a problem there, but it may well be
> "only" a problem in error handling.
>
> As Bill's trace(get, ..) shows, R tries to get
> "#HAS_DUPLICATE_CLASS_NAMES" which is indeed an indication of the problem:
>
> You are trying to REdefine a class union that already exists
> identically in the Matrix package:
> In the R-forge development version of 'Matrix', it is
> line 717 of Matrix/R/AllClass.R (and that will be close also
> in the CRAN version of Matrix).
>
> So at least for you, Renaud, the solution to the problem is easy:
> Just don't do what you should not do: What you want is already
> part of Matrix and after searching: It's been part of
> Matrix since ca. July 2012 ...
>
> -
>
> But yes, there's a buglet in the 'methods' package currently,
> which leads to a misleading error message
> (It's arguable if it should give an error which it did not previously;
> I think it would be quite a good idea to give at least a
> warning as you are masking class definition of the Matrix
> package which is in your search() path or at least among the
> loaded namespaces at this time).
>
> Best,
> Martin
>
> > ‐‐‐ Original Message ‐‐‐
>
> > On Wednesday, April 8, 2020 11:19 AM, William Dunlap 
>  wrote:
>
>
> >> Use trace() to get a bit more detail - .__C_compMatrix is looked for in 
> >> the wrong environment with inherits=FALSE.
>
> >>
>
> >>> setClassUnion("mMatrix", c("Matrix", "matrix"))
>
> >> Tracing get(name, envir = env) on entry
>
> >> x=".AllMTable", envir="", 
> topenv="", inherits=TRUE
>
> >> Tracing get(name, envir = env) on entry
>
> >> x=".MTable", envir="", topenv=" namespace:methods>", inherits=TRUE
>
> >> Tracing get(name, envir = env) on entry
>
> >> x=".AllMTable", envir="", 
> topenv="", inherits=TRUE
>
> >> Tracing get("#HAS_DUPLICATE_CLASS_NAMES", envir = .classTable) on entry
>
> >> x="#HAS_DUPLICATE_CLASS_NAMES", envir="", 
> topenv="", inherits=TRUE
>
> >> Tracing get(name, envir = env) on entry
>
> >> x=".AllMTable", envir="", 
> topenv="", inherits=TRUE
>
> >> Tracing get(name, envir = env) on entry
>
> >> x=".MTable", envir="", topenv=" namespace:methods>", inherits=TRUE
>
> >> Tracing get(name, envir = env) on entry
>
> >> x=".MTable", envir="", topenv=" namespace:methods>", inherits=TRUE
>
> >> Tracing get(".SigLength", envir = env) on entry
>
> >> x=".SigLength", envir="", 
> topenv="", inherits=TRUE
>
> >> Tracing get(".SigLength", envir = env) on entry
>
> >> x=

Re: [R-pkg-devel] Error creating union class: object ‘.__C__compMatrix’ not found

2020-04-08 Thread renozao
Thank you William for the reproducible example.

Currently I using the following (same as in William's example):
setClassUnion("mMatrix", c("Matrix", "matrix"))

Martin, are the changes made in the union class handling affecting the way we 
should declare them?
Thank you.

Bests,
Renaud

‐‐‐ Original Message ‐‐‐
On Wednesday, April 8, 2020 11:19 AM, William Dunlap  wrote:

> Use trace() to get a bit more detail - .__C_compMatrix is looked for in the 
> wrong environment with inherits=FALSE.
>
>> setClassUnion("mMatrix", c("Matrix", "matrix"))
> Tracing get(name, envir = env) on entry
> x=".AllMTable", envir="", topenv=" namespace:methods>", inherits=TRUE
> Tracing get(name, envir = env) on entry
> x=".MTable", envir="", topenv=" namespace:methods>", inherits=TRUE
> Tracing get(name, envir = env) on entry
> x=".AllMTable", envir="", topenv=" namespace:methods>", inherits=TRUE
> Tracing get("#HAS_DUPLICATE_CLASS_NAMES", envir = .classTable) on entry
> x="#HAS_DUPLICATE_CLASS_NAMES", envir="", 
> topenv="", inherits=TRUE
> Tracing get(name, envir = env) on entry
> x=".AllMTable", envir="", topenv=" namespace:methods>", inherits=TRUE
> Tracing get(name, envir = env) on entry
> x=".MTable", envir="", topenv=" namespace:methods>", inherits=TRUE
> Tracing get(name, envir = env) on entry
> x=".MTable", envir="", topenv=" namespace:methods>", inherits=TRUE
> Tracing get(".SigLength", envir = env) on entry
> x=".SigLength", envir="", topenv=" namespace:methods>", inherits=TRUE
> Tracing get(".SigLength", envir = env) on entry
> x=".SigLength", envir="", topenv=" namespace:methods>", inherits=TRUE
> Tracing get(name, envir = env) on entry
> x=".MTable", envir="", topenv=" namespace:methods>", inherits=TRUE
> Tracing get(".SigLength", envir = env) on entry
> x=".SigLength", envir="", topenv=" namespace:methods>", inherits=TRUE
> Tracing get(".SigLength", envir = env) on entry
> x=".SigLength", envir="", topenv=" namespace:methods>", inherits=TRUE
> Tracing get(cname, envir = cwhere, inherits = FALSE) on entry
> x=".__C__compMatrix", envir="", 
> topenv="", inherits=FALSE
> Error in get(cname, envir = cwhere, inherits = FALSE) :
>   object '.__C__compMatrix' not found
> ...
>
> Bill Dunlap
> TIBCO Software
> wdunlap tibco.com
>
> On Wed, Apr 8, 2020 at 7:52 AM William Dunlap  wrote:
>
>> % R-devel --vanilla --quiet
>>> library(Matrix)
>>> setClassUnion("mMatrix", c("Matrix", "matrix"))
>> Error in get(cname, envir = cwhere, inherits = FALSE) :
>>   object '.__C__compMatrix' not found
>> Error in setClassUnion("mMatrix", c("Matrix", "matrix")) :
>>   unable to create union class:  could not set members "Matrix"
>>> sessionInfo()
>> R Under development (unstable) (2020-04-07 r78175)
>> Platform: x86_64-pc-linux-gnu (64-bit)
>> Running under: Ubuntu 16.04.6 LTS
>>
>> Matrix products: default
>> BLAS/LAPACK: /usr/lib/libopenblasp-r0.2.18.so
>>
>> locale:
>>  [1] LC_CTYPE=en_US.UTF-8   LC_NUMERIC=C
>>  [3] LC_TIME=en_US.UTF-8LC_COLLATE=en_US.UTF-8
>>  [5] LC_MONETARY=en_US.UTF-8LC_MESSAGES=en_US.UTF-8
>>  [7] LC_PAPER=en_US.UTF-8   LC_NAME=C
>>  [9] LC_ADDRESS=C   LC_TELEPHONE=C
>> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
>>
>> attached base packages:
>> [1] stats graphics  grDevices utils datasets  methods   base
>>
>> other attached packages:
>> [1] Matrix_1.2-18
>>
>> loaded via a namespace (and not attached):
>> [1] compiler_4.1.0  grid_4.1.0  lattice_0.20-41
>>
>> Bill Dunlap
>> TIBCO Software
>> wdunlap tibco.com
>>
>> On Wed, Apr 8, 2020 at 7:35 AM Martin Maechler  
>> wrote:
>>
>>>>>>>> renozao
>>>>>>>> on Mon, 30 Mar 2020 21:20:43 + writes:
>>>
>>> > Hi,
>>> > when R CMD check is run under R-devel (2020-03-29 r78108) I get the 
>>> following error at installation:
>>>
>>> > Error in get(cname, envir = cwhere, inhe

Re: [R-pkg-devel] Error creating union class: object ‘.__C__compMatrix’ not found

2020-04-06 Thread renozao
Hi,
following up on this.
Has anybody encountered this issue or could give some insights on it?
Is there anything I can do here, except avoiding using Matrix in the union 
class?

Thanks
[[alternative HTML version deleted]]

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


[R-pkg-devel] Error creating union class: object ‘.__C__compMatrix’ not found

2020-03-30 Thread renozao
Hi,

when R CMD check is run under R-devel (2020-03-29 r78108) I get the following 
error at installation:

Error in get(cname, envir = cwhere, inherits = FALSE) :
  object ‘.__C__compMatrix’ not found
Error in setClassUnion("mMatrix", c("Matrix", "matrix")) :
  unable to create union class:  could not set members "Matrix"

This does not happen on R 3.6.3.

I tried with Matrix listed in Depends but I still get the same error.

Is this linked to some changes in union classes or the Matrix package?

Thank you.

Bests,

Renaud
[[alternative HTML version deleted]]

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel