[Bioc-devel] How to recreate R CMD BUILD environment in interactive session?

Martin Morgan martin.morgan at roswellpark.org
Mon Oct 23 16:35:17 CEST 2017

On 10/23/2017 09:59 AM, Elizabeth Purdom wrote:
>> On Oct 23, 2017, at 3:47 PM, Martin Morgan 
>> <martin.morgan at roswellpark.org <mailto:martin.morgan at roswellpark.org>> 
>> wrote:
>> On 10/23/2017 09:26 AM, Elizabeth Purdom wrote:
>>> Hello,
>>> I am updating an existing package and I am getting an error in 
>>> running my vignette (and a similar error in an example in help pages) 
>>> but ONLY when I run R CMD BUILD. I can’t recreate the error in any 
>>> session where I can debug and figure out what is happening. So my 
>>> question is how can I recreate the exact environment of R CMD BUILD 
>>> that runs the vignette but in an interactive session so that I can 
>>> figure out what is going on?
>>> I have tried reproducing the error in other environments:
>>> * Running R —vanilla interactively and trying the code manually
>>> * running purl on my vignette to get pure R code and running just the 
>>> R code with R CMD BATCH —vanilla
>> hint on the specific package and / or error message?
>> My approach would be to install the package, Stangle / purl the 
>> vignette, and R -f vignette.R, then trim the vignette to a fast 
>> reproducible case. But it sounds like you're doing that...
>> Martin
> Yes, that is what I tried but did not get the error from the R code.
> And I apologize, it’s the `clusterExperiment` package. My error was so 
> specific to the class created by my package that I didn’t think it would 
> be useful, but here is the relevant error message:
> Quitting from lines 271-272 (clusterExperimentTutorial.Rmd)
> Error: processing vignette 'clusterExperimentTutorial.Rmd' failed with 
> diagnostics:
> invalid class "ClusterExperiment" object: merge_nodeMerge must have 4 
> columns and column names equal to: 
> 'Node','Contrast','isMerged','mergeClusterId'
> Execution halted
> I would note that my vignette calls an object that is saved as a data 
> object as part of my package to speed up compilation. But I experimented 
> and you can also switch it so that it creates the object from scratch 
> and doesn’t load the object, and it runs into the same error. There is a 
> `LazyData: false` in my DESCRIPTION File, because I was having problems 
> with my R data object, because it is of the class I make with my 
> package, and without the package loaded there was some problem loading it.

I can reproduce the error with

clusterExperiment/vignettes master$ R_DEFAULT_PACKAGES= LC_COLLATE=C R 
-f clusterExperimentTutorial.R

leading to

 > ## 
Error in validObject(.Object) :
   invalid class "ClusterExperiment" object: merge_nodeMerge must be 
data.frame with 4 columns and column names equal to: 
Calls: RSEC ... .local -> new -> initialize -> initialize -> validObject
Execution halted

and then for work inside R

clusterExperiment/vignettes$ R_DEFAULT_PACKAGES= LC_COLLATE=C R
Bioconductor version 3.6 (BiocInstaller 1.27.7), ?biocLite for help
 > source("clusterExperimentTutorial.R", echo=TRUE, max=Inf)

Does that set you down the right path?



This email message may contain legally privileged and/or...{{dropped:2}}

More information about the Bioc-devel mailing list