A3 <- read.csv('A3_Pierce_Standard_0001_A3_26-07-17_13-30_0002.csv')
C4 <- read.csv('c4_digested20minlycice_0001_C4_26-07-17_15-16_0001.csv')
#STEP TWO COLUMN SLICE
A3new <- A3[,1:2]
C4new <- C4[,1:2]
names(A3new) <- c('m_z','int')
names(C4new) <- c('m_z','int')
A3filtered <- A3new[A3new$int>100,]
A3filtered <- A3new[A3new$int>1000,]
A3filtered <- A3new[A3new$int>1000,]
C4filtered <- C4new[C4new$int>100,]
A3filtered$m_z <- round(A3filtered$m_z)
C4filtered$m_z <- round(C4filtered$m_z)
matchDF <- merge(A3filtered,
C4filtered,by="m_z")
A3tidy <- cbind(sample='Standard',A3filtered)
C4tidy <- cbind(sample='digest',C4filtered)
Matchtidy <- cbind(sample='Match',
matchDF[,c(1,3)])
names(Matchtidy) <- c('sample','m_z','int')
tidyDF <- rbind(A3tidy,
C4tidy,
Matchtidy)
##STEP SIX: Plot using ggplot and facet wrap
ggplot(tidyDF, aes(x = m_z,y=int))+
geom_col(aes(colour = sample ,fill=sample))+
xlab("m/z ratio") + ylab("Millivolts")+
facet_wrap(~sample,nrow=3)