[R] Barplots

2013-08-14 Thread Alexander Gotowski
Hi, I'm attempting to make a bar plot for some genomics data that includes a separate bar for each sample taken. I am having trouble applying these sample labels to the individual bars. It seems that the barplot() function will only take a numeric matrix, and therefore cannot have any

Re: [R] Barplots

2013-08-14 Thread Sarah Goslee
Hi, Your question doesn't quite make sense to me, and since you didn't provide a reproducible example it's impossible to really know what you're doing. Have you read ?barplot and tried the examples? There's a names.arg argument that takes a character vector that is used for labels. Otherwise the

Re: [R] Barplots

2013-08-14 Thread Jim Lemon
On 08/14/2013 10:40 PM, Alexander Gotowski wrote: Hi, I'm attempting to make a bar plot for some genomics data that includes a separate bar for each sample taken. I am having trouble applying these sample labels to the individual bars. It seems that the barplot() function will only

Re: [R] Barplots inside loop - several data errors, workaround needed

2012-05-10 Thread Lee
Looking at the documentation for try() I am not sure how it would be best applied in this situation. My background is not extensively programming. Would writing a function first be appropriate? Also, I'm not sure just a simple error catch would solve my first problem. I do, in fact, need it to

Re: [R] Barplots inside loop - several data errors, workaround needed

2012-05-10 Thread Steve Lianoglou
Hi, On Thu, May 10, 2012 at 8:35 PM, Lee muell...@gmail.com wrote: Looking at the documentation for try() I am not sure how it would be best applied in this situation. My background is not extensively programming. Would writing a function first be appropriate? Also, I'm not sure just a

[R] Barplots inside loop - several data errors, workaround needed

2012-05-09 Thread Lee
I have a series of data which is managed through a loop. The loop creates pivot tables of my data using the *cast* function in the *reshape*library. For the most part, the data is all plotted correctly. Unfortunately, there are a couple of data sets which create errors and halt the loop. One of

Re: [R] Barplots inside loop - several data errors, workaround needed

2012-05-09 Thread Jim Holtman
?try Sent from my iPad On May 8, 2012, at 22:03, Lee muell...@gmail.com wrote: I have a series of data which is managed through a loop. The loop creates pivot tables of my data using the *cast* function in the *reshape*library. For the most part, the data is all plotted correctly.

[R] barplots of several variables with different number of categories

2012-03-01 Thread jon waterhouse
If I have two factors, v1 and v2 and I want to have a stacked bar graph of the two variables side by side I could do barplot(cbind(table(v1),table(v2))) if v1 and v2 have the same number of categories. If they don't have the same number of categories this won't work. I'm sure there's a simple

Re: [R] barplots of several variables with different number of categories

2012-03-01 Thread ilai
Jon, You could create new variables with the combined levels just for the purpose of plotting. Assume I have data.frame bpt str(bpt) 'data.frame': 12 obs. of 2 variables: $ V1: Factor w/ 3 levels low,med,high: 1 1 1 1 2 2 2 2 3 3 ... $ V2: Factor w/ 6 levels 1,2,3,4,..: 1 1 2 2 3 3 4 4 5 5

Re: [R] barplots

2011-10-09 Thread Carlos Ortega
Hi, Another way to do that is with function barchart() in package lattice. Barchart requires a function which relates your variables with the option to specify groups. Check the examples (are under xyplot help) to apply them to your case. Regards, Carlos Ortega www.qualityexcellence.es On Thu,

Re: [R] barplots

2011-10-07 Thread Jim Lemon
On 10/07/2011 08:16 AM, Daniel Winkler wrote: Hello, I have somewhat of a weird data set and am attempting to create a barplot with it. I have 8 columns with different variables and their percentages. I have 1 column with representations of 4 different treatments the variables undergo. I also

[R] barplots

2011-10-06 Thread Daniel Winkler
Hello, I have somewhat of a weird data set and am attempting to create a barplot with it. I have 8 columns with different variables and their percentages. I have 1 column with representations of 4 different treatments the variables undergo. I also have 1 column with year the data was recorded. I

Re: [R] barplots with 2 different scales

2010-10-01 Thread Jim Lemon
On 10/01/2010 09:19 AM, Jeremy Claisse wrote: Is there a way to create barplots with pairs of bars plotted on 2 different scales (i.e some bars would be plotted according to the scale on the y-axis on the left and other bars plotted according to a different scale on the right axis)? Hi Jeremy,

[R] barplots with 2 different scales

2010-09-30 Thread Jeremy Claisse
Is there a way to create barplots with pairs of bars plotted on 2 different scales (i.e some bars would be plotted according to the scale on the y-axis on the left and other bars plotted according to a different scale on the right axis)? Thank you, Jeremy [[alternative HTML version

[R] Barplots, was Re: (no subject)

2010-09-10 Thread peter dalgaard
On Sep 10, 2010, at 11:38 , Tanvir Khan wrote: Hello, I'm trying to do bar plot where 'sex' will be the category axis and 'occupation' will represent the bars and the clusters will represent the mean 'income'. sex occupation income 1 female j 12 2male

[R] Barplots

2010-07-13 Thread Ravi S. Shankar
Hi R, I am examining the mean returns 10 days before and 10 days after a event. Now I have several events the corresponding pre and post event 10 day mean returns... something like this Pre_Start Pre_End Pre_MeanPre_SD Post_StartPost_End

[R] Barplots in R

2010-01-15 Thread vikrant
Suppose I need to draw a Grouped bar plot with 100 values on the X axis. Now my question is If I need to highlight suppose first three values by some color say 'red' and also I need to highlight last 5 datavalues by some color say 'blue' and the rest of the data in between I need not display. Is

Re: [R] Barplots in R

2010-01-15 Thread K. Elo
Hi! Let's suppose the values for the x axis are stored in 'values'. barplot(values, col=c(rep(Red,3),rep(1,length(values)-8),rep(Blue,5))) HTH, Kimmo vikrant kirjoitti: Suppose I need to draw a Grouped bar plot with 100 values on the X axis. Now my question is If I need to highlight suppose

Re: [R] barplots and missing xlabels

2008-01-14 Thread Jim Lemon
Geoff Russell wrote: Dear useRs, The following plots only print 2 of the 4 labels under the bars, is there a way please to force all 4 labels to print? par(mfrow=c(1,2),mar=c(2,7,3,1)) dat-data.frame(AgeGroup=c(2-15,16-20,21-25,26-39), Aorta=c(20,8,30,60), Coronary=c(7,30,55,65))

Re: [R] barplots and missing xlabels

2008-01-14 Thread Geoff Russell
See below On 1/14/08, Jim Lemon [EMAIL PROTECTED] wrote: Geoff Russell wrote: Dear useRs, The following plots only print 2 of the 4 labels under the bars, is there a way please to force all 4 labels to print? par(mfrow=c(1,2),mar=c(2,7,3,1))

Re: [R] barplots and missing xlabels

2008-01-14 Thread John Kane
It is printing all four labels, The window is just not large enough to show them. In Windows anyway,grab the window and stretch it (to the left probably) . --- Geoff Russell [EMAIL PROTECTED] wrote: Dear useRs, The following plots only print 2 of the 4 labels under the bars, is there a

Re: [R] barplots and missing xlabels

2008-01-14 Thread -Halcyon-
Hi, I'd say just stretch the plot window. The code works fine and labels are all present Gz Jim Lemon-2 wrote: Geoff Russell wrote: Dear useRs, The following plots only print 2 of the 4 labels under the bars, is there a way please to force all 4 labels to print?

Re: [R] barplots and missing xlabels

2008-01-14 Thread Geoff Russell
On 1/15/08, -Halcyon- [EMAIL PROTECTED] wrote: Hi, I'd say just stretch the plot window. The code works fine and labels are all present The labels didn't appear on my pdf output but the following code worked fine xpos-barplot(dat$Aorta,ylim=c(0,100), names=rep(,length(dat$AgeGroup)),

[R] barplots and missing xlabels

2008-01-13 Thread Geoff Russell
Dear useRs, The following plots only print 2 of the 4 labels under the bars, is there a way please to force all 4 labels to print? par(mfrow=c(1,2),mar=c(2,7,3,1)) dat-data.frame(AgeGroup=c(2-15,16-20,21-25,26-39), Aorta=c(20,8,30,60), Coronary=c(7,30,55,65))