[R] scatterplot to boxplot translation?
Tom Fletcher
tom.fletcher.mp7e at statefarm.com
Fri Dec 9 20:55:43 CET 2011
You need to create some grouping for your cut points (0-100, etc).
See ?cut
Then, you can use boxplot and formula (y ~ NEWVARIABLE from cut)
boxplot(y ~ cut(x))
There may be other ways to do this, but the above should work.
TF
-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of Vining, Kelly
Sent: Friday, December 09, 2011 1:11 PM
To: Vining, Kelly; r-help at r-project.org
Subject: Re: [R] scatterplot to boxplot translation?
My apologies if anyone is seeing this twice...looks like my previous message didn't come through...
Dear UseRs,
I have a feeling this is a relatively simple question, but I'm having a hard time getting my head around it. I have a simple x-y scatterplot with many points, as shown below(attached). I'd like to make a boxplot of this by interval, such that there is one box representing the points in the 0-100 interval, one for the 101-200 interval, and so on. How do I structure my R data frame to be able to generate such a boxplot?
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of Vining, Kelly
Sent: Friday, December 09, 2011 11:01 AM
To: r-help at r-project.org
Subject: [R] scatterplot to boxplot translation?
More information about the R-help
mailing list