[R] Place independent labels between values on x-axis

T.D.Rudolph prairie.picker at gmail.com
Thu Feb 26 00:48:33 CET 2009


I conducted a frequency averaging procedure which left me with the data frame
below (Bin is an artifact of a cut() procedure and can be either
as.character or as.factor):

           Bin     Freq
1  (-180,-160] 7.904032
2  (-160,-140] 5.547901
3  (-140,-120] 4.522542
4  (-120,-100] 4.784184
5   (-100,-80] 4.490083
6    (-80,-60] 4.754268
7    (-60,-40] 5.597407
8    (-40,-20] 5.964031
9      (-20,0] 7.266519
10      (0,20] 6.947202
11     (20,40] 6.168730
12     (40,60] 4.918232
13     (60,80] 4.638589
14    (80,100] 4.288087
15   (100,120] 4.091052
16   (120,140] 4.451199
17   (140,160] 5.869740
18   (160,180] 7.796204

I am able to present the data as a histogram using barplot(), but on the
x-axis I would like to see the values that separate (i.e. that are located
between) my various bins (i.e. seq(-180,180,20)).  Thus 0 would appear
directly under the centre line that separates (-20,0] and (0,20], etc.

barplot(angledist$Freq, xlab="Turning Angle", ylab="Average frequency (%)",
ylim=c(0,10))

?names.arg, ?xlim don't seem to do it but I could be wrong....
Tyler
-- 
View this message in context: http://www.nabble.com/Place-independent-labels-between-values-on-x-axis-tp22214730p22214730.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list