mercredi 28 octobre 2015

graphing multiple columns from a data frame with a for loop

hey I'm trying to graph multiple columns from a data frame. And below is in example of the data.

transect.y  GT218_1 GT218_2 T223_1  T223_2  L18_1   L18_2   GT1_1   GT1_2   L5_1    L5_2    Myrt3_1
570 114 116 102 116 135 149 208 208 124 126 191
570 114 114 102 116 135 149 208 208 124 126 193
570 114 116 102 116 135 149 208 208 124 126 197
570 112 112 102 116 135 151 208 208 124 126 197
570 112 112 102 116 135 149 208 208 124 126 197
316 112 112 116 116 145 147 198 214 126 126 193
316 112 112 116 116 145 147 210 214 126 134 191
316 112 112 116 116 145 147 198 214 126 134 193

I'm only trying to graph the columns in between GT218 and end in Myrt. Below is my code

a <- as.double(My_dataexcel_output[[9:20]]) 

for (i in a) {  
  if (a == a ) { 
    x2 <-My_dataexcel_outputdata$a
    columnx2 <- factor(x2)
    hist(columnx2)    
    }
}

Aucun commentaire:

Enregistrer un commentaire