[R-pkg-devel] trivial package with R CMD check ERRORs that seem unrelated to package contents

Richard M. Heiberger rmh at temple.edu
Thu May 28 17:04:54 CEST 2015


These "Error in validObject(.Object) : messages started appearing with
* using R Under development (unstable) (2015-02-12 r67812)
and are in the released R-3.2.0

I am seeing it now because I last posted HH_3.1-15 to CRAN in February
and have mostly
used R CMD INSTALL --build until now for my updates.  now I am getting
ready to send another
revision to CRAN and these errors, some of which appear to me to
depend on conflicts between other
packages, are keeping my package from passing the check.

On the e1071, I do have it. I am not using it here. Some other package
is doing something with it.
Rcmdr suggests e1071.
The line just following the error on e1071 says
     It looks like this package has a loading problem when not on .libPaths:

Please look at the thread on this list "ERROR from R CMD check that I
have never seen before",
particularly my message "Mon, May 25, 2015 at 12:59 PM", where I
indicate some of the conflicts I know about.

On the R-devel, I installed it from scratch and all packages are
consistent with that date.

I find the messages "Error in validObject(.Object) :" to be
noninformative.  Can you revise them to
indicate what line in what function triggered them?

I am certainly willing to do more selective imports.  I would like the
check to give me more information on which.

Here is another example (not in the posted checks)

* checking replacement functions ... WARNING
Error in validObject(.Object) :
  invalid class "ObjectsWithPackage" object: superclass "atomicVector"
not defined in the environment of the object's class
Calls: <Anonymous> ... metaNameUndo -> new -> initialize -> initialize
-> validObject
Execution halted
The argument of a replacement function which corresponds to the right
hand side must be named 'value'.

I checked my assignments.  They are ok.  I think this message is
coming from some function in some package
that was indirectly loaded or imported.  I don't know which.  I don't
know how to find out which.
ls(pat="<-") doesn't see inside namespaces.

On Thu, May 28, 2015 at 10:10 AM, Duncan Murdoch
<murdoch.duncan at gmail.com> wrote:
> On 28/05/2015 9:19 AM, Richard M. Heiberger wrote:
>>
>> I posted a package
>>      trivial_3.1-18.tar.gz
>> and the
>>      00check-trivial.log
>> from R-devel at
>>
>>       http://astro.temple.edu/~rmh/HH-test/
>>
>> The package contains one function
>> trivial <- function(...) {}
>> and a NAMESPACE that imports other packages.
>>
>> The 00check-trivial.log has many messages that look like they depend
>> on aspects of the imported packages, including five of these
>>      Error in validObject(.Object) :
>>
>> I need guidance on how to respond to these.
>>
>> My real package
>>      HH_3.1-17.tar.gz
>> is also there along with a clean check log from R-3.1.2 and a check log
>> I don't understand from R-devel.
>
>
> You're importing a lot of packages.  I think the first set of warnings
>
> * checking whether package 'trivial' can be installed ... WARNING
> Found the following significant warnings:
>   Warning: replacing previous import by 'shiny::radioButtons' when loading
> 'trivial'
>   Warning: replacing previous import by 'stats::dbinom' when loading
> 'trivial'
>   Warning: replacing previous import by 'stats::pnorm' when loading
> 'trivial'
>   Warning: replacing previous import by 'stats::dnorm' when loading
> 'trivial'
>   Warning: replacing previous import by 'stats::dpois' when loading
> 'trivial'
>   Warning: replacing previous import by 'latticeExtra::rootogram' when
> loading 'trivial'
>
> could mean what they say: you already have a function called radioButtons
> imported,  and shiny::radioButtons is masking it, and similarly for the
> other warnings. Or it could be a bug in R-devel. If it really is a case of
> masking, the solution is probably to import less:  just name the functions
> you really need, don't import everything.
>
> The error
>
> Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck =
> vI[[j]]) :
>   there is no package called 'e1071'
> Error: package or namespace load failed for 'trivial'
> Execution halted
>
>
> appears to be clear. You don't import e1071, but presumably one of your
> imports does,  and you don't have it.
>
> I would guess the reason you didn't get the warnings previously is because
> it's a new check, and you didn't get the error because you did have e1071,
> or you were using different versions of the imported packages, and they
> didn't need it.
>
> The errors like
>
> Error in validObject(.Object) :
>   invalid class "ObjectsWithPackage" object: superclass "atomicVector" not
> defined in the environment of the object's class
> Execution halted
>
>
> could be a bug in R-devel, or perhaps they are caused by using old versions
> of packages rather than reinstalling them for R-devel. I'm not sure what
> your response should be to these.   You could try install.packages() on all
> the dependencies just to be sure you have the latest builds; If they're an
> R-devel bug, they'll probably go away soon.
>
> Duncan Murdoch
>
>



More information about the R-package-devel mailing list