Re: [R] scatterplot to boxplot translation?

2011-12-09 Thread Vining, Kelly
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-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On 
Behalf Of Vining, Kelly
Sent: Friday, December 09, 2011 11:01 AM
To: r-help@r-project.org
Subject: [R] scatterplot to boxplot translation?


attachment: C_count_vs_RPKM.png__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] scatterplot to boxplot translation?

2011-12-09 Thread David Winsemius


On Dec 9, 2011, at 2:11 PM, Vining, Kelly wrote:

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?




?cut



From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org 
] On Behalf Of Vining, Kelly

Sent: Friday, December 09, 2011 11:01 AM
To: r-help@r-project.org
Subject: [R] scatterplot to boxplot translation?


C_count_vs_RPKM.png__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


David Winsemius, MD
West Hartford, CT

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] scatterplot to boxplot translation?

2011-12-09 Thread Vining, Kelly
Thanks for the tip on cut, seems like it should work. I must still be missing 
something, though. Here, I'm cutting on the y variable, then attempting the 
boxplot:

cutRPKM - cut(count$RPKM, breaks=4)

head(cutRPKM)
[1] (-0.0995,24.8] (-0.0995,24.8] (-0.0995,24.8] (-0.0995,24.8] (-0.0995,24.8]
[6] (-0.0995,24.8]
Levels: (-0.0995,24.8] (24.8,49.8] (49.8,74.7] (74.7,99.6]

boxplot(as.numeric(cutRPKM))

This gives me a single box instead of five boxes. ??

Thanks again,
--Kelly V.

From: David Winsemius [dwinsem...@comcast.net]
Sent: Friday, December 09, 2011 11:14 AM
To: Vining, Kelly
Cc: r-help@r-project.org
Subject: Re: [R] scatterplot to boxplot translation?

On Dec 9, 2011, at 2:11 PM, Vining, Kelly wrote:

 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?


?cut


 From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org
 ] On Behalf Of Vining, Kelly
 Sent: Friday, December 09, 2011 11:01 AM
 To: r-help@r-project.org
 Subject: [R] scatterplot to boxplot translation?


 C_count_vs_RPKM.png__
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.

David Winsemius, MD
West Hartford, CT

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] scatterplot to boxplot translation?

2011-12-09 Thread Uwe Ligges



On 09.12.2011 20:41, Vining, Kelly wrote:

Thanks for the tip on cut, seems like it should work. I must still be missing 
something, though. Here, I'm cutting on the y variable, then attempting the boxplot:

cutRPKM- cut(count$RPKM, breaks=4)

head(cutRPKM)
[1] (-0.0995,24.8] (-0.0995,24.8] (-0.0995,24.8] (-0.0995,24.8] (-0.0995,24.8]
[6] (-0.0995,24.8]
Levels: (-0.0995,24.8] (24.8,49.8] (49.8,74.7] (74.7,99.6]

boxplot(as.numeric(cutRPKM))

This gives me a single box instead of five boxes. ??



You obviously want:

boxplot(count$RPKM ~ cut(count$RPKM, breaks=seq(0, max(count$RPKM), 
by=100)))



Uwe Ligges



Thanks again,
--Kelly V.

From: David Winsemius [dwinsem...@comcast.net]
Sent: Friday, December 09, 2011 11:14 AM
To: Vining, Kelly
Cc: r-help@r-project.org
Subject: Re: [R] scatterplot to boxplot translation?

On Dec 9, 2011, at 2:11 PM, Vining, Kelly wrote:


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?



?cut



From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org
] On Behalf Of Vining, Kelly
Sent: Friday, December 09, 2011 11:01 AM
To: r-help@r-project.org
Subject: [R] scatterplot to boxplot translation?


C_count_vs_RPKM.png__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


David Winsemius, MD
West Hartford, CT

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] scatterplot to boxplot translation?

2011-12-09 Thread Tom Fletcher
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-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On 
Behalf Of Vining, Kelly
Sent: Friday, December 09, 2011 1:11 PM
To: Vining, Kelly; r-help@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-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On 
Behalf Of Vining, Kelly
Sent: Friday, December 09, 2011 11:01 AM
To: r-help@r-project.org
Subject: [R] scatterplot to boxplot translation?

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] scatterplot to boxplot translation?

2011-12-09 Thread David Winsemius


On Dec 9, 2011, at 2:50 PM, Uwe Ligges wrote:




On 09.12.2011 20:41, Vining, Kelly wrote:
Thanks for the tip on cut, seems like it should work. I must  
still be missing something, though. Here, I'm cutting on the y  
variable, then attempting the boxplot:


cutRPKM- cut(count$RPKM, breaks=4)

head(cutRPKM)
[1] (-0.0995,24.8] (-0.0995,24.8] (-0.0995,24.8] (-0.0995,24.8]  
(-0.0995,24.8]

[6] (-0.0995,24.8]
Levels: (-0.0995,24.8] (24.8,49.8] (49.8,74.7] (74.7,99.6]

boxplot(as.numeric(cutRPKM))

This gives me a single box instead of five boxes. ??



You obviously want:

boxplot(count$RPKM ~ cut(count$RPKM, breaks=seq(0, max(count$RPKM),  
by=100)))


In that context (having defined a cut-variable with single-integer  
break argument),  would have thought this should work:


 boxplot(count$RPKM ~ cutRPKM)

--
David.




Uwe Ligges



Thanks again,
--Kelly V.

From: David Winsemius [dwinsem...@comcast.net]
Sent: Friday, December 09, 2011 11:14 AM
To: Vining, Kelly
Cc: r-help@r-project.org
Subject: Re: [R] scatterplot to boxplot translation?

On Dec 9, 2011, at 2:11 PM, Vining, Kelly wrote:


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?



?cut



From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org
] On Behalf Of Vining, Kelly
Sent: Friday, December 09, 2011 11:01 AM
To: r-help@r-project.org
Subject: [R] scatterplot to boxplot translation?


C_count_vs_RPKM.png__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


David Winsemius, MD
West Hartford, CT

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


David Winsemius, MD
West Hartford, CT

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.