问题
I'm in need of assistance... I'm using R to analyze some data... I have a frequency table called mytable... that I created like this:
mytable=table(cut(var1,12),cut(var2,12))
the table looks something like this:
1-2 2-3 3-4
1-3 2 1 2
3-6 0 1 4
6-9 7 1 8
except is a 12 by 12 table.
I used boxplot.matrix(mytable),the boxplot looks ok... with the 12 boxes corresponding to my 12 stratums, but my boxplot has the frequency as the y-axis and I want the y-axis to be the values from var1, how can I do this?
I wanted to post a pic... but my rep wasnt high enough
回答1:
use boxplot before you summarize your data.
boxplot(var1)
If you want to see the distribution per split, use the formula format:
boxplot(var1 ~ cut(var2, 12))
来源:https://stackoverflow.com/questions/19594259/r-boxplot-frequency