Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

load_all on package with S4 classes fails #823

Closed
DarwinAwardWinner opened this issue May 28, 2015 · 3 comments
Closed

load_all on package with S4 classes fails #823

DarwinAwardWinner opened this issue May 28, 2015 · 3 comments

Comments

@DarwinAwardWinner
Copy link

I'm trying to do some development on BiocParallel (https://github.com/Bioconductor/BiocParallel), which defines an S4 class hierarchy across several R files. When I attempt to use load_all() on it, I get:

> load_all()
Loading BiocParallel
Error in getClass(what, where = where) (from BatchJobsParam-class.R#9) : 
  "BiocParallelParam" is not a defined class

This looks kind of like #623, but the error message is different, so I'm not sure if it's the same issue.

> sessionInfo()
R version 3.2.0 (2015-04-16)
Platform: x86_64-unknown-linux-gnu (64-bit)
Running under: Ubuntu 14.04.2 LTS

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_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] grDevices datasets  parallel  graphics  stats4    stats     utils    
[8] methods   base     

other attached packages:
[1] devtools_1.8.0.9000  foreach_1.4.2        plyr_1.8.2          
[4] stringr_1.0.0        IRanges_2.2.1        ggplot2_1.0.1       
[7] S4Vectors_0.6.0      BiocGenerics_0.14.0  BiocInstaller_1.18.2

loaded via a namespace (and not attached):
 [1] Rcpp_0.11.6          git2r_0.10.1         futile.logger_1.4.1 
 [4] bitops_1.0-6         futile.options_1.0.0 iterators_1.0.7     
 [7] tools_3.2.0          digest_0.6.8         memoise_0.2.1       
[10] gtable_0.1.2         proto_0.3-10         httr_0.6.1          
[13] roxygen2_4.1.1       rversions_1.0.0      grid_3.2.0          
[16] snow_0.3-13          XML_3.98-1.1         reshape2_1.4.1      
[19] lambda.r_1.1.7       magrittr_1.5         scales_0.2.4        
[22] codetools_0.2-11     MASS_7.3-40          colorspace_1.2-6    
[25] stringi_0.4-1        RCurl_1.96-0         munsell_0.4.2    
@Geoff99
Copy link
Contributor

Geoff99 commented May 28, 2015

Hi @DarwinAwardWinner , Issue #623 should be fixed in the versions of devtools and roxygen2 your sessionInfo report mentions, so it's probably not that.

Just a guess - have you got #' @include filename.r type roxygen2 comments in your various files, to ensure that the collate sequence in the DESCRIPTION file is correct. By default devtools loads files in alphabetical order of the filenames, which can lead to code being out of order and hence R may be trying to create a subclass before it knows about the superclass (if the correct collate order is not alphabetical). PS If you have manually entered the collate sequence in the DESCRIPTION file don't use the #' @include approach - it would wipe out all the manual entries :-(

Or alternatively, if the missing superclass (BiocParallelParam) comes from another package, you might be missing an #' @importClassesFrom whateverpkg BiocParallelParam type statement.

Emphasise these are both just guesses. Hope they help though.

PPS Both guesses wrong - sorry. Just had a look at your github link and you have manually created collate sequences in the DESCRIPTION file, which have BioParallelParam defined before BatchJobsParam. Maybe something to do with the fact you have both Collate.unix and Collate.windows entries is confusing devtools or roxygen2?

I'll have to leave this to someone more knowledgeable than me.

Collate.unix: AllGenerics.R BiocParallelParam-class.R ErrorHandling.R 
 bpbackend-methods.R bpisup-methods.R bplapply-methods.R bpmapply-methods.R 
 bpiterate-methods.R bpschedule-methods.R bpstart-methods.R bpstop-methods.R 
 bpvec-methods.R bpvectorize-methods.R bpworkers-methods.R 
 bpaggregate-methods.R bpvalidate.R SnowParam-class.R MulticoreParam-class.R 
 register.R SerialParam-class.R DoparParam-class.R SnowParam-utils.R 
 BatchJobsParam-class.R progress.R utilities.R unix/pvec.R  
 unix/mclapply.R unix/zzz.R 

Collate.windows: AllGenerics.R BiocParallelParam-class.R ErrorHandling.R 
 bpbackend-methods.R bpisup-methods.R bplapply-methods.R bpmapply-methods.R 
 bpiterate-methods.R bpschedule-methods.R bpstart-methods.R bpstop-methods.R 
 bpvec-methods.R bpvectorize-methods.R bpworkers-methods.R 
 bpaggregate-methods.R bpvalidate.R SnowParam-class.R MulticoreParam-class.R 
 register.R SerialParam-class.R DoparParam-class.R SnowParam-utils.R 
 BatchJobsParam-class.R progress.R utilities.R windows/zzz.R 

@hadley
Copy link
Member

hadley commented Jun 19, 2015

The problem is that you're using collate.unix and collate.windows which devtools doesn't know about. I'd be happy to accept a PR to add support (you'd need to patch https://github.com/hadley/devtools/blob/master/R/load-code.r#L40-L65). They're rare enough that I don't have the time to add support myself.

@hadley hadley closed this as completed Jun 19, 2015
@lock
Copy link

lock bot commented Sep 18, 2018

This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/

@lock lock bot locked and limited conversation to collaborators Sep 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants