Re: [R] Histogram

2008-07-23 Thread Vincent Goulet
Le mer. 23 juil. à 14:29, Angelo Scozzarella a écrit : Hi, how can I treat data organised in classes and frequencies? Ex. class frequency 20-23 9 23-25 7 26-28 5 29-31 5 32-34 3 It depends

Re: [R] histogram plot default

2008-07-18 Thread jim holtman
Doesn't it now? PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. On Thu, Jul 17, 2008 at 8:26 AM, Xin [EMAIL PROTECTED] wrote: Dear All: I am trying to plot a series of data using histogram plot.

[R] Histogram with two colors depending on condition

2008-07-17 Thread Mohammad Ehsanul Karim
Dear List, Say, we generate data like this- dat-rnorm(1000,1,2) hist(dat) How do i make the histogram, say, red (col = 2) before X = dat = 0, and rest say, green (col = 3) beyond X = dat = 0 in R? The resulting histogram could be like this http://ehsan.karim.googlepages.com/histogram.JPG

Re: [R] Histogram with two colors depending on condition

2008-07-17 Thread jim holtman
Here is something that is close: x - rnorm(1) y - hist(x, plot=FALSE) plot(y, col=ifelse(y$mid0,'red','green')) On Thu, Jul 17, 2008 at 5:13 AM, Mohammad Ehsanul Karim [EMAIL PROTECTED] wrote: Dear List, Say, we generate data like this- dat-rnorm(1000,1,2) hist(dat) How do i

Re: [R] Histogram with two colors depending on condition

2008-07-17 Thread hadley wickham
On Thu, Jul 17, 2008 at 5:13 PM, Mohammad Ehsanul Karim [EMAIL PROTECTED] wrote: Dear List, Say, we generate data like this- dat-rnorm(1000,1,2) hist(dat) library(ggplot) qplot(dat, geom=histogram, colour = factor(dat 0)) Hadley -- http://had.co.nz/

[R] histogram plot default

2008-07-17 Thread Xin
Dear All: I am trying to plot a series of data using histogram plot. But I want to change the default of setting for histogram plot. For example, I want to set frequency plot starting with zero. Many Thanks Xin [[alternative HTML version deleted]]

Re: [R] Histogram with two colors depending on condition

2008-07-17 Thread Greg Snow
Subject: [R] Histogram with two colors depending on condition Dear List, Say, we generate data like this- dat-rnorm(1000,1,2) hist(dat) How do i make the histogram, say, red (col = 2) before X = dat = 0, and rest say, green (col = 3) beyond X = dat = 0 in R? The resulting histogram could

[R] Histogram with colors according to factor

2008-07-08 Thread Hans W. Borchers
Given a data frame with a continuous variable and a factor. I would like to generate a histogram of the continuous variable, where each bar is filled with different colors according to the percentage of factor values falling into this region of the continuous variable. I looked into packages

Re: [R] Histogram with colors according to factor

2008-07-08 Thread ONKELINX, Thierry
: dinsdag 8 juli 2008 13:23 Aan: r-help@r-project.org Onderwerp: [R] Histogram with colors according to factor Given a data frame with a continuous variable and a factor. I would like to generate a histogram of the continuous variable, where each bar is filled with different colors according

Re: [R] Histogram with colors according to factor

2008-07-08 Thread Hans W. Borchers
No; thanks for your try, but this is not what I want. Here each bar has one single color. I would like to render each bar with several colors according to the distribution of a factor. I now learned that this is called stacked histogram (damned Excel). In the following entry

Re: [R] Histogram with colors according to factor

2008-07-08 Thread hadley wickham
Given a data frame with a continuous variable and a factor. I would like to generate a histogram of the continuous variable, where each bar is filled with different colors according to the percentage of factor values falling into this region of the continuous variable. How exactly do you want

Re: [R] Histogram inset into another histogram

2008-06-19 Thread Paul Hiemstra
Victor Homar wrote: Dear R users and helpers, I'm trying to find an example of a histogram plot as an inset (upper right or left corner) of another histogram. Anyone has an example of that? Thanks for your help, Víctor. Hi, You can use the histogram function from the lattice package

Re: [R] Histogram inset into another histogram

2008-06-19 Thread Victor Homar
Hi Paul, Thanks for the answer. I temporarily did it with the subplot function from the TeachingDemos package but I like this version much better. Best, Victor. Paul Hiemstra wrote: Victor Homar wrote: Dear R users and helpers, I'm trying to find an example of a histogram plot as an inset

[R] Histogram inset into another histogram

2008-06-18 Thread Victor Homar
Dear R users and helpers, I'm trying to find an example of a histogram plot as an inset (upper right or left corner) of another histogram. Anyone has an example of that? Thanks for your help, Víctor. -- --- Víctor Homar

[R] histogram

2008-06-13 Thread Paul Adams
Hello everyone, I am trying to plot a histogram from the following code: dat-read.table(file=C:\\Documents and Settings\\Owner\\My Documents\\Yeast\\Yeast.txt,header=T,row.names=1) file.show(file=C:\\Documents and Settings\\Owner\\My Documents\\Yeast\\Yeast.txt) x-dat[2,23:46]

Re: [R] histogram

2008-06-13 Thread jim holtman
It is hard to respond without reproducible examples. Do str(dat[2,23:46]) and see what it reports. My guess is that one of the columns is not numeric. Find out which one it is, fix it and then try 'hist' again. On Fri, Jun 13, 2008 at 10:21 AM, Paul Adams [EMAIL PROTECTED] wrote: Hello

Re: [R] histogram

2008-06-13 Thread Erik Iverson
Paul Adams wrote: Hello everyone, I am trying to plot a histogram from the following code: dat-read.table(file=C:\\Documents and Settings\\Owner\\My Documents\\Yeast\\Yeast.txt,header=T,row.names=1) file.show(file=C:\\Documents and Settings\\Owner\\My Documents\\Yeast\\Yeast.txt)

Re: [R] histogram

2008-06-13 Thread Lars Fischer
Hi, please someone correct me, but On 13/06/2008, 07:21, [EMAIL PROTECTED] wrote: dat-read.table(file=C:\\Documents and Settings\\Owner\\My Documents\\Yeast\\Yeast.txt,header=T,row.names=1) Check mode and class of dat. read.table provided you with a dataframe of, essentially, string data.

Re: [R] histogram

2008-06-13 Thread Peter Dalgaard
jim holtman wrote: It is hard to respond without reproducible examples. Do str(dat[2,23:46]) and see what it reports. My guess is that one of the columns is not numeric. Find out which one it is, fix it and then try 'hist' again. No, this will be wrong whatever the data are. The problem

[R] Histogram of gaps

2008-06-10 Thread Creighton, Sean
Hi I consider myself not a complete beginner in R, however an elegant solution to this problem stumps me. I have a fairly long time series of 6 or so points, I need to gather the data to create a histogram of the length of continuous zero periods in a data set. So image the data looks like

Re: [R] Histogram of gaps

2008-06-10 Thread Chuck Cleland
On 6/10/2008 9:23 AM, Creighton, Sean wrote: Hi I consider myself not a complete beginner in R, however an elegant solution to this problem stumps me. I have a fairly long time series of 6 or so points, I need to gather the data to create a histogram of the length of continuous zero periods

[R] histogram tick labels

2008-06-09 Thread Lawrence Hanser
Dear Friends, I am doing a rather simple histogram on a vector of data, MR. I set breaks for the intervals: hist(MR,breaks=c(0, 2.9, 5.9, 8.9, 11.9,14.9, 17.9, 20.9)) My question is, how do I change the labels on the tick marks? I have looked at ?hist and can't find a clue... Thanks in

Re: [R] histogram tick labels

2008-06-09 Thread S Ellison
Lawrence, use hist(..., axes=F) then put your own axis on with axis(1,...) Example: y-rnorm(200) hist(y,axes=F) axis(2) axis(1, at=seq(-3,3,1)) Steve E Lawrence Hanser [EMAIL PROTECTED] 06/09/08 7:02 AM Dear Friends, I am doing a rather simple histogram on a vector of data, MR. I set breaks

[R] histogram

2008-05-16 Thread Roslina Zakaria
Hi r-expert, I would like to plot histogram using frequency not density. But I got the following warning.  obs.hist - hist(jan_data2[,4],right=FALSE,breaks=c(0,5,10,15,20,100),freq=TRUE, + xlab=Rain amt (mm),ylim=c(0,3000), + main=Frequency of observed, Jan (1901-1990),

Re: [R] histogram

2008-05-16 Thread Bill.Venables
CSIRO Laboratories PO Box 120, Cleveland, 4163 AUSTRALIA -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Roslina Zakaria Sent: Friday, 16 May 2008 4:12 PM To: R help forum Subject: [R] histogram Hi r-expert, I would like to plot histogram using frequency

Re: [R] histogram() with Date class?

2008-05-09 Thread Ola Caster
Thanks a lot Deepayan. Could you please inform me what update are you referring to, and give me some very vague sense when it might happen (within weeks, months, or years)? Many thanks Ola 2008/5/8 Deepayan Sarkar [EMAIL PROTECTED]: On 5/8/08, Ola Caster [EMAIL PROTECTED] wrote: Dear help

Re: [R] histogram() with Date class?

2008-05-09 Thread Ola Caster
Sorry for spamming the list... I noticed that if you first produce a date histogram with the hist() function, like this: basic.histogram - hist(my.data$date, breaks = months, plot = FALSE) and then try to transfer the breaks from that histogram to a lattice equivalent, like this:

Re: [R] histogram() with Date class?

2008-05-09 Thread Deepayan Sarkar
On 5/9/08, Ola Caster [EMAIL PROTECTED] wrote: Sorry for spamming the list... I noticed that if you first produce a date histogram with the hist() function, like this: basic.histogram - hist(my.data$date, breaks = months, plot = FALSE) and then try to transfer the breaks from that

[R] histogram() with Date class?

2008-05-08 Thread Ola Caster
Dear help list, Is it possible to draw lattice histograms (i.e. use the histogram() function and not the hist() function) with objects of class Date? I've tried solutions like histogram(~date, data=my.data, breaks=months) but it doesn't seem to work. Any suggestions are welcome. Many thanks

[R] histogram

2008-05-08 Thread Roslina Zakaria
Dear R-expert, For histogram function, can we get the table of bin and frequency like in excel, together with the histogram? Therefore, we can check the number of data included. Thank you so much for your attention and help.

Re: [R] histogram

2008-05-08 Thread Rolf Turner
On 9/05/2008, at 12:04 PM, Roslina Zakaria wrote: Dear R-expert, For histogram function, can we get the table of bin and frequency like in excel, together with the histogram? Therefore, we can check the number of data included. Thank you so much for your attention and help. ?hist

Re: [R] histogram

2008-05-08 Thread David Scott
On Thu, 8 May 2008, Roslina Zakaria wrote: Dear R-expert, For histogram function, can we get the table of bin and frequency like in excel, together with the histogram? Therefore, we can check the number of data included. Thank you so much for your attention and help. Easy one: just use the

Re: [R] histogram

2008-05-08 Thread Ted Harding
On 09-May-08 00:12:46, David Scott wrote: On Thu, 8 May 2008, Roslina Zakaria wrote: Dear R-expert, For histogram function, can we get the table of bin and frequency like in excel, together with the histogram? Therefore, we can check the number of data included. Thank you so much for your

Re: [R] histogram

2008-05-08 Thread Jorge Ivan Velez
Hi all, Why not only? set.seed(54321) X - 5*rnorm(500) hist(X,label=TRUE,ylim=c(0,200)) Thanks, Jorge On Thu, May 8, 2008 at 8:26 PM, Ted Harding [EMAIL PROTECTED] wrote: On 09-May-08 00:12:46, David Scott wrote: On Thu, 8 May 2008, Roslina Zakaria wrote: Dear R-expert, For

[R] Histogram Label Font Size

2008-04-14 Thread Sue Lee
Hi! I'm having a trouble changing font size of histogram label. I have tried help(hist), but I couldn't find anything explain how to fix label's font size. Could you help me please? Thank you. _ Going green? See the top 12 foods

Re: [R] Histogram Label Font Size

2008-04-14 Thread Henrique Dallazuanna
I think that you can edit the source code of histogram for this: myhist - getS3method(plot, histogram) body(myhist)[9] - parse(text = c(capture.output(body(myhist)[9])[-6], } else labels, adj = c(0.5, -0.5), ...))) r - hist(islands, plot = F) myhist(r, labels = T, cex =

Re: [R] Histogram Label Font Size

2008-04-14 Thread Robert Baer
Here's an example to make the text 18 point. You can set ps=6 to make small text. x=rnorm(100) opar=par(ps=18) # Make text 18 point hist(x) opar Rob Baer - Original Message - From: Sue Lee [EMAIL PROTECTED] To: r-help@r-project.org Sent: Monday, April 14, 2008 2:35 PM Subject: [R

[R] histogram for integer data

2008-03-27 Thread Erwann.Rogard
hi, library(lattice) x-c(-1,-1,-1,0,0,0,0,1,1,2) rng-range(x) histogram(x,endpoints=c(rng[1]-0.5,rng[2]+0.5),nint=length(unique(x))) instead of contiguous bins, i'd like spaces between them to indicate that the data is discrete, or even better, line segments positioned at integer values. i

Re: [R] histogram for integer data

2008-03-27 Thread Don MacQueen
You might consider something based on the concept of: y - table( x) plot( as.numeric(names(y)) , y, type='h') -Don At 2:59 PM -0400 3/27/08, [EMAIL PROTECTED] wrote: hi, library(lattice) x-c(-1,-1,-1,0,0,0,0,1,1,2) rng-range(x)

Re: [R] histogram for integer data

2008-03-27 Thread Erwann.Rogard
Thanks! Yes, but I also want to be able to condition easily hence histogram(...), not plot -Original Message- From: Don MacQueen [mailto:[EMAIL PROTECTED] Sent: Thursday, March 27, 2008 3:55 PM To: Rogard, Erwann RD/US/EXT; r-help@r-project.org Subject: Re: [R] histogram for integer

Re: [R] histogram like x labels in barplot

2008-03-06 Thread Henrique Dallazuanna
If I understand: barplot(x) axis(1) On 06/03/2008, Hyunchul Kim [EMAIL PROTECTED] wrote: Hi, all I drew a barplot with barplot(data1, beside=TRUE) and then, I want to labels with hist() like x-axis ticks. How can I do this? Thanks in advance, Hyunchul

[R] histogram like x labels in barplot

2008-03-06 Thread Hyunchul Kim
Hi, all I drew a barplot with barplot(data1, beside=TRUE) and then, I want to labels with hist() like x-axis ticks. How can I do this? Thanks in advance, Hyunchul __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] Histogram in Lattice with 3 factors

2008-02-11 Thread Deepayan Sarkar
On 2/11/08, willem vervoort [EMAIL PROTECTED] wrote: Dear R-help list, I am trying to construct a lattice histogram using 3 factors. My dataframe looks like this: (simulating a waterbalance over groundwater with different salinities) s days modelECEC_max 0.4 1A

[R] Histogram in Lattice with 3 factors

2008-02-11 Thread willem vervoort
Dear R-help list, I am trying to construct a lattice histogram using 3 factors. My dataframe looks like this: (simulating a waterbalance over groundwater with different salinities) s days modelECEC_max 0.4 1A 10 9 0.42 2A 10 9 0.44 3

Re: [R] Histogram in Lattice with 3 factors

2008-02-11 Thread willem vervoort
Thanks Deepayan, that did the trick Willem On Feb 12, 2008 9:46 AM, Deepayan Sarkar [EMAIL PROTECTED] wrote: On 2/11/08, willem vervoort [EMAIL PROTECTED] wrote: Dear R-help list, I am trying to construct a lattice histogram using 3 factors. My dataframe looks like this: (simulating a

Re: [R] Histogram/Bar plot graph

2008-02-06 Thread ONKELINX, Thierry
Kumar M Verzonden: woensdag 6 februari 2008 11:19 Aan: r-help@r-project.org Onderwerp: [R] Histogram/Bar plot graph Hi, I have the following data: Myvalues Gene ES MEF Embryo ESHyp 1 GeneA -0.38509507 0.00 1.6250 1.7039921 2 GeneB0.06262914 0.00 1.6250 -0.272033

Re: [R] Histogram/Bar plot graph

2008-02-06 Thread Senthil Kumar M
On Feb 6, 2008 2:35 AM, ONKELINX, Thierry [EMAIL PROTECTED] wrote: You'll need to transform your dataset in a long format first. library(ggplot2) n - 5 MyValues - data.frame(Gene = factor(LETTERS[seq_len(n)]), ES = rnorm(n), MEF = rnorm(n), Embrio = rnorm(n), EShyp = rnorm(n)) MyValuesMelt

Re: [R] histogram with NAs

2008-01-18 Thread Gustaf Rydevik
On Jan 18, 2008 4:49 PM, [EMAIL PROTECTED] wrote: Dear list, I have a categorical variable in a data.frame that I would like to plot using a histogram to show number of events. Values are 0, 1 and some NAs. I can´t make the hist() function to 1) include a column with the number of NAs 2)

[R] histogram with NAs

2008-01-18 Thread darteta001
Dear list, I have a categorical variable in a data.frame that I would like to plot using a histogram to show number of events. Values are 0, 1 and some NAs. I can´t make the hist() function to 1) include a column with the number of NAs 2) have the x axis to be categorical, I always get 0, 0.2,

Re: [R] histogram with NAs

2008-01-18 Thread hadley wickham
Typical plots with vertical bars are not histograms. Consider barplot or plot(*, type = h) for such bar plots. . But no worry, I've mixed them up myself a number of times. Or you can use ggplot2, which will do the right thing regardless of whether you have continuous or categorical data:

Re: [R] Histogram from frequency table?

2008-01-11 Thread Duncan Murdoch
On 1/11/2008 8:55 AM, Brian Nguyen wrote: Hi, I've had some trouble figuring out how to produce a histogram in R directly given a frequency table or relative frequency table. I've looked through the documentation and mailing list, and have only found information on producing histograms

[R] Histogram from frequency table?

2008-01-11 Thread Brian Nguyen
Hi, I've had some trouble figuring out how to produce a histogram in R directly given a frequency table or relative frequency table. I've looked through the documentation and mailing list, and have only found information on producing histograms given the original data set. Any help would be

Re: [R] Histogram with different colors for different portions

2007-12-31 Thread Greg Snow
-project.org Subject: [R] Histogram with different colors for different portions Dear Rusers, I would like to color different sections of a histogram different colors. I have an example that was done by brute force given below. Has anyone implemented something like this in general? If not, any

[R] Histogram with different colors for different portions

2007-12-30 Thread arnholtat
Dear Rusers, I would like to color different sections of a histogram different colors. I have an example that was done by brute force given below. Has anyone implemented something like this in general? If not, any suggestions/pointers on how to write a general function to do so would be most

[R] histogram plot as step function

2007-11-15 Thread Hakim Tafer
Hi I want to plot a histogram (not cumulative!) as a step-function. Any idea how achieve this? Thank you __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] histogram plot as step function

2007-11-15 Thread David Scott
On Thu, 15 Nov 2007, Hakim Tafer wrote: Hi I want to plot a histogram (not cumulative!) as a step-function. Any idea how achieve this? Thank you Well if I understand you correctly you can do this. x-rnorm(100) par(mfrow=c(2,1)) hist(x) histRes - hist(x,plot=FALSE) xvals - histRes$breaks

Re: [R] histogram labels

2007-10-18 Thread H. Paul Benton
Jim Lemon wrote: Hi Paul, It looks like you have a 1548 bar histogram, which means that you can't even resolve the bars on the standard display, much less annotate them. umm yes but I know that I only want to see everything from 0 : 150 so it's ends up only being 300bar's which I agree is

Re: [R] histogram labels

2007-10-18 Thread hadley wickham
Hi Paul, Why do you want to do that? Maybe you could publish table along side your graph if you want people to be able to read the raw numbers. Hadley On 10/16/07, H. Paul Benton [EMAIL PROTECTED] wrote: Dear all, Just a quick one, hopefully. I have a histogram made from the method

[R] histogram labels

2007-10-16 Thread H. Paul Benton
Dear all, Just a quick one, hopefully. I have a histogram made from the method 'hist()'. How do I get labels on the bars? Such that the bars will have the x axis on the bar, not the frequency of the point but the number of the point itself. To make a quick summary, I want the the numbers from

<    1   2   3   4