f<-read.table("http://eagle.fish.washington.edu/cnidarian/BiGo_lar_F_methratio_v9_A.txt", header=T, sep="\t",) classes<-sapply(m1,class) m1big<-read.table("http://eagle.fish.washington.edu/cnidarian/BiGo_lar_T3D5_methratio_v9_A.txt", header=T, sep="\t", colClasses=classes) m15fold<-m1big[m1big$CT_count >= 5, c(1,4,5,8)] head(m15fold) m1_5xCGonly<-m15fold[grep(".{2}CG.{1}",m15fold$context), ] head(m1_5xCGonly) plot(m1_5xCGonly, col =) m1_duo<-m1big[grepl(".{2}CG.{1}",m1big$context) & m1big$CT_count >= 5, ] #make a histogram, breaking it 100 hist(m1_duo$ratio, 100) write.table(m1_duo,"test.txt", sep="\t", row.names = F, quote = F)