I am struggling with combining multiple conditionals in R. I was able to make it work for the single conditional but i keep getting error with multiple conditionals. Here is a example..
options<-matrix(c('lincRNA', 'l', 1, "character",
'lincRNAbed', 'b', 1, "character",
'overlap', 'v', 2, "character",
'tss', 't', 2, "character",
'help', 'h', 0, "logical"),
ncol=4,byrow=TRUE)
ret.opts<-getopt(options,args)
My R script is something like this
if(is.null(ret.opts$tss)) {
-------------------------
} else if(is.null(ret.opts$overlap)) {
-------------------------
} else if(is.null(ret.opts$tss) && is.null(ret.opts$overlap)){
-------------------------
}
But when run it with single conditional it works but i when run multiple conditional, i keep getting error
Rscript ../../final_summary_table_gen_evo-I.R --lincRNA lincRNAs.fa --lincRNAbed lincRNAs.bed
Error in .normarg_input_filepath(filepath) :
'filepath' must be a character vector with no NAs
Calls: readDNAStringSet ... fasta.index -> <Anonymous> -> .normarg_input_filepath
Execution halted
I know the syntax for multiple conditionals is wrong but i can't figure out what it is. I tried different ways but without success.
Aucun commentaire:
Enregistrer un commentaire