[R] Boxplot by factors

Marc Schwartz MSchwartz at MedAnalytics.com
Wed Feb 2 21:38:25 CET 2005


On Wed, 2005-02-02 at 14:29 -0600, msck9 at mizzou.edu wrote:
> Dear all, 
>  I have the following data format
> 
> 
>  cellnumber    force
>  	1	100
> 	1	230
> 	1	100
> 	1 	200
> 	1	130
> 	1	210
> 	2	179
> 	2	298
> 	2	400
> 	2	500
> 	2	600
> 	...........
> I want to make a boxplot of the force according to the cellnumber. Here
> the cellnumber is actually a factor. It has 1, 2 two levels. How can I
> do that using boxplot? 


boxplot(force ~ cellnumber)

See the formula method and the first example in ?boxplot

HTH,

Marc Schwartz




More information about the R-help mailing list