[R] label histogram question

Aimin Yan aiminy at iastate.edu
Fri Mar 2 05:17:26 CET 2007


Dear R list:

I have a data like this
 > head(data.19.pr.2)
     pr    Ave    Sd M#    Re  Aa
1 1A24  57.66 33.50 20 ALA_1 ALA
2 1A24  72.16 19.75 20 GLN_2 GLN
3 1A24 103.52  8.64 20 TYR_3 TYR
4 1A24  38.67 15.51 20 GLU_4 GLU
5 1A24  54.56 16.43 20 ASP_5 ASP
6 1A24 999.00  0.00 20 GLY_6 GLY
 > levels(data.19.pr.2$Aa)
  [1] "ALA" "ARG" "ASN" "ASP" "CYS" "GLN" "GLU" "GLY" "HIS" "ILE" "LEU" 
"LYS" "MET" "PHE" "PRO" "SER" "THR" "TRP" "TYR" "VAL"

I want to do histogram for Sd grouped by 20 levels of Aa, and put 20 
histograms in one page.
I use this code to do job

par(mfrow=c(4,5))
tapply(data.19.pr.2$Sd,data.19.pr.2$Aa,hist)

I get all 20 histogram in one page,but main label of each histogram is 
labeled by "Histogram of X[[1]]" and xlab is labeled by "X[[1]]".
I want to change these labels using 20 levels of Aa . it look like this: 
"Histogram of ALA"

Does anyone know how to code these?

Aimin



More information about the R-help mailing list