plotcompound <-
function(num, ftlist, results){

index  <- results[,c(1,2,4,6:dim(results)[2])]
label  <- colnames(index)
index  <- index[which(index[,1]==num),]
label  <- label[which(index>0)]
index  <- index[which(index>0)]
cols <- c("black","red","blue","yellow","azure","brown","blueviolet","cyan","magenta","orange","purple")
if (length(label)==0){
  label <- c("C12isotope")
  index <- num
}
ge  <- split.screen(c(ceiling(length(label)/2),2))
int <- c()
for (i in 1:length(label)){
    screen(ge[i])
    par(oma=c(.1,.0,.0,.0))
    par(mar=c(4, 4, 2, 0))
    par(lab=c(4,4,5))
    barplot(ftlist$data[index[i],], names.arg=seq(1,length(ftlist$data[index[i],]),1), xlab="sample index", ylab = "LC/MS intensity", main=paste(label[i],":rt=",round(ftlist$rt[index[i]],1),":m/z=",round(ftlist$mz[index[i]],3),sep=""), col=cols[i],cex.names=.7, cex.axis = .7, cex.main = 1.4)
    grid()
    par(oma=c(3,3,3,3))
    par(lab=c(5,5,7))
    par(mar=c(5,4,4,2)+0.1)
    int <- c(int,mean(ftlist$data[index[i],]))
}
close.screen(all = TRUE)
names(int) <- label
int <- int/int[1]
return(int)
}
