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

Error in if (outputType == "MAST" & !requireNamespace("MAST", quietly = TRUE)) stop("for outputType 'MAST', you must have package 'MAST' from Bioconductor installed.") : the condition has length > 1 #216

Closed
HenrikBengtsson opened this issue Aug 31, 2017 · 1 comment

Comments

@HenrikBengtsson
Copy link

I'm seeing the below error when running R CMD check --as-cran on clusterExperiment (1.3.2) with _R_CHECK_LENGTH_1_CONDITION_=true.

checking examples ... ERROR
Running examples inclusterExperiment-Ex.Rfailed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: clusterContrasts,ClusterExperiment-method
> ### Title: Create contrasts for testing DE of a cluster
> ### Aliases: clusterContrasts,ClusterExperiment-method clusterContrasts
> ###   clusterContrasts,vector-method
> 
> ### ** Examples
> 
> data(simData)
> cl <- clusterMany(simData,nPCADims=c(5,10,50),  dimReduce="PCA",
+ clusterFunction="pam", ks=2:4, findBestK=c(FALSE), removeSil=TRUE,
+ subsample=FALSE)
> #Pairs:
> clusterContrasts(cl,contrastType="Pairs")
Error in if (outputType == "MAST" & !requireNamespace("MAST", quietly = TRUE)) stop("for outputType 'MAST', you must have package 'MAST' from Bioconductor installed.") : 
  the condition has length > 1
Calls: clusterContrasts ... .local -> clusterContrasts -> clusterContrasts -> .local
Execution halted

FYI, with _R_CHECK_LENGTH_1_CONDITION_=true we get:

> Sys.setenv("_R_CHECK_LENGTH_1_CONDITION_" = "true")
> if (1:2 == 1) TRUE
Error in if (1:2 == 1) TRUE : the condition has length > 1

whereas without we only get a warning:

> Sys.setenv("_R_CHECK_LENGTH_1_CONDITION_" = "false")

> if (1:2 == 1) TRUE
[1] TRUE
Warning message:
In if (1:2 == 1) TRUE :
  the condition has length > 1 and only the first element will be used
@epurdom
Copy link
Owner

epurdom commented Sep 7, 2017

Thanks. This was due to a missing match.arg in clusterContrasts when I added the argument of outputType to handle MAST format. I have committed a fix to this on both the master and develop branch (commit 125b7aa).

@epurdom epurdom closed this as completed Sep 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants