R/writePeaklist.R

Defines functions writePeaklist

Documented in writePeaklist

writePeaklist <-
function(MSlist,directory,filename,overwrite=FALSE){

      ##########################################################################
      if(!length(MSlist)==8){stop("This is not an MSlist object")}
      if(!MSlist[[1]][[5]]){stop("MSlist does not contain picked peaks - abort.")}
      if(!file.exists(directory)){stop("invalid directory")}     
      fileout<-paste(directory,"\\",filename,sep="")
      if(file.exists(fileout) & !overwrite){stop("file already exists; cannot overwrite!")}
      ##########################################################################      
      write.table(MSlist[[8]],file=fileout)
      ##########################################################################

}

Try the enviPick package in your browser

Any scripts or data that you put into this service are public.

enviPick documentation built on May 29, 2017, 10:55 a.m.