Re: [R] Histogram/BoxPlot Panel

2009-12-29 Thread Dennis Murphy
Hi: To make a more legible ordering of the plots, it might be a good idea to make m$L1 an ordered factor rather than a character variable: m$L1 - ordered(m$L1, levels = paste('dataset', 1:15, sep = '')) # Lattice bwplot(value ~ x | L1, data = m, as.table = TRUE) # ggplot2 ggplot(m)+

[R] Histogram probabilities 1 ????!!!

2009-12-02 Thread Trafim
Hi everybody, well, I definitely don't understand anything. Why the hist function with freq=FALSE gives such a strange result??? R - c(-1.10, 0.79, -1.17, -0.53, -0.26, -0.22, 0.29, -0.26, -0.26, 0.39) hist(R, freq=FALSE, breaks=10) Thanks everybody [[alternative HTML version

Re: [R] Histogram probabilities 1 ????!!!

2009-12-02 Thread Peter Flom
Trafim rdapam...@gmail.com wrote well, I definitely don't understand anything. Why the hist function with freq=FALSE gives such a strange result??? R - c(-1.10, 0.79, -1.17, -0.53, -0.26, -0.22, 0.29, -0.26, -0.26, 0.39) hist(R, freq=FALSE, breaks=10) The total AREA has to equal 1, which

Re: [R] Histogram probabilities 1 ????!!!

2009-12-02 Thread guohao.huang
PM To: r-help@r-project.org Subject: [R] Histogram probabilities 1 !!! Hi everybody, well, I definitely don't understand anything. Why the hist function with freq=FALSE gives such a strange result??? R - c(-1.10, 0.79, -1.17, -0.53, -0.26, -0.22, 0.29, -0.26, -0.26, 0.39) hist(R, freq

Re: [R] Histogram probabilities 1 ????!!!

2009-12-02 Thread Gene Leynes
. Guo-Hao Huang -- From: Trafim rdapam...@gmail.com Sent: Wednesday, December 02, 2009 7:35 PM To: r-help@r-project.org Subject: [R] Histogram probabilities 1 !!! Hi everybody, well, I definitely don't understand anything

[R] Histogram and Density on the the same graph

2009-11-30 Thread Trafim
Dear all, I cannot find a function which would allow drawing hist and density on the same graph. x - seq(1,40,1) y - 2*x+1+5*rnorm(length(x)) hist(y,freq = FALSE) plot(density(y)) thanks a lot for the help [[alternative HTML version deleted]]

Re: [R] Histogram and Density on the the same graph

2009-11-30 Thread Ted Harding
On 30-Nov-09 11:09:12, Trafim wrote: Dear all, I cannot find a function which would allow drawing hist and density on the same graph. x - seq(1,40,1) y - 2*x+1+5*rnorm(length(x)) hist(y,freq = FALSE) plot(density(y)) thanks a lot for the help plot() initiates a completely new plot,

Re: [R] Histogram and Density on the the same graph

2009-11-30 Thread Trafim
Thanks a lot Ted! I use R help but also cannot find how to expand the graph, i.e. sometimes the top of it is cut for some reason. Maybe there are some limits imposed on y axes, but cannot find it. On Mon, Nov 30, 2009 at 12:27 PM, Ted Harding ted.hard...@manchester.ac.ukwrote: On 30-Nov-09

Re: [R] Histogram and Density on the the same graph

2009-11-30 Thread Hrishi Mittal
Trafim, If you are plotting more than one variables on the same plot e.g. by using the lines() or points() function, then the limits of the X and Y axes are set based on the first variable you plot. So, you would have to set the xlim and ylim to the limits of the variable with the widest range,

Re: [R] Histogram and Density on the the same graph

2009-11-30 Thread Rainer M Krug
Chek the topic Second y-axis --- alternative to par(new= which was discussed recently - in that one, there are a few examples, how that can be achieved. Essentially, you have to make sure, that the xlims of the hist() and plot(density()) are the same, and you have to use the par(new=TRUE) (or

Re: [R] Histogram and Density on the the same graph

2009-11-30 Thread Trafim
I plot only hist(y,freq = FALSE) lines(density(y)) and the graph of density goes higher then hist, but i didn't find any lim parameter for y axes for lines command. Thanks a lot On Mon, Nov 30, 2009 at 1:51 PM, Hrishi Mittal hrishimit...@gmail.comwrote: Trafim, If you are plotting more

Re: [R] Histogram and Density on the the same graph

2009-11-30 Thread Ted Harding
Trafim, If you are plotting more than one variables on the same plot e.g. by using the lines() or points() function, then the limits of the X and Y axes are set based on the first variable you plot. So, you would have to set the xlim and ylim to the limits of the variable with the widest

[R] Histogram and Density on the the same graph

2009-11-30 Thread Trafim
Dear all, I cannot find a function which would allow drawing hist and density on the same graph. x - seq(1,40,1) y - 2*x+1+5*rnorm(length(x)) hist(y,freq = FALSE) plot(density(y)) thanks a lot for the help [[alternative HTML version deleted]]

Re: [R] Histogram and Density on the the same graph

2009-11-30 Thread ONKELINX, Thierry
-project.org] Namens Trafim Verzonden: maandag 30 november 2009 12:01 Aan: r-help@r-project.org Onderwerp: [R] Histogram and Density on the the same graph Dear all, I cannot find a function which would allow drawing hist and density on the same graph. x - seq(1,40,1) y - 2*x+1+5*rnorm(length(x)) hist(y

Re: [R] Histogram and Density on the the same graph

2009-11-30 Thread Jakson A. Aquino
On Mon, Nov 30, 2009 at 12:01:12PM +0100, Trafim wrote: Dear all, I cannot find a function which would allow drawing hist and density on the same graph. x - seq(1,40,1) y - 2*x+1+5*rnorm(length(x)) hist(y,freq = FALSE) plot(density(y)) The package descr has the function histkdnc()

Re: [R] histogram

2009-10-14 Thread Jim Lemon
On 10/13/2009 10:06 PM, Dmitry Gospodaryov wrote: Dear R developers,How I can build a histogram from matrix: 0 0.5 1 0.25 34 43 65 1 23 35 54 4 22 29 42 10 21 22 29 20 15 17 20 (first string is represented names of columns, first column is represented names of rows) where names of columns

[R] histogram

2009-10-13 Thread Dmitry Gospodaryov
Dear R developers,How I can build a histogram from matrix: 0 0.5 1 0.25 34 43 65 1 23 35 54 4 22 29 42 10 21 22 29 20 15 17 20 (first string is represented names of columns, first column is represented names of rows) where names of columns should be x-axis labels; respectively to this, I want

Re: [R] histogram

2009-10-13 Thread joris meys
see ?hist On Tue, Oct 13, 2009 at 1:06 PM, Dmitry Gospodaryov gospodar...@rambler.ru wrote: Dear R developers,How I can build a histogram from matrix: 0 0.5 1 0.25 34 43 65 1 23 35 54 4 22 29 42 10 21 22 29 20 15 17 20 (first string is represented names of columns, first column is

Re: [R] histogram

2009-10-13 Thread joris meys
On second thought, You'll have to reorganize your data first, and then check the function histogram() in the package lattice. cheers On Wed, Oct 14, 2009 at 12:43 AM, joris meys jorism...@gmail.com wrote: see ?hist On Tue, Oct 13, 2009 at 1:06 PM, Dmitry Gospodaryov gospodar...@rambler.ru

[R] histogram

2009-10-08 Thread Khanh Nguyen
Hi all, I have a question about hist() 1) t1 - hist(c(1,2,3,4,5)) t1 $breaks [1] 1 2 3 4 5 $counts [1] 2 1 1 1 why is there 2 counts for 1? And should the counts be '1 1 1 1 1' ? Is there any other function to count frequency of discrete data? Thanks. -k [[alternative HTML

Re: [R] histogram

2009-10-08 Thread Erik Iverson
For simply counting frequency of discrete data, table , xtabs, and ftable will work. -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Khanh Nguyen Sent: Thursday, October 08, 2009 2:47 PM To: r-help@r-project.org Subject: [R

Re: [R] histogram

2009-10-08 Thread Henrique Dallazuanna
Change the breaks argument: t1 - hist(1:5, 0:5) t1$counts On Thu, Oct 8, 2009 at 4:47 PM, Khanh Nguyen kngu...@cs.umb.edu wrote: Hi all, I have a question about hist() 1) t1 - hist(c(1,2,3,4,5)) t1 $breaks [1] 1 2 3 4 5 $counts [1] 2 1 1 1 why is there 2 counts for 1? And should

Re: [R] histogram

2009-10-08 Thread David Winsemius
On Oct 8, 2009, at 3:47 PM, Khanh Nguyen wrote: Hi all, I have a question about hist() 1) t1 - hist(c(1,2,3,4,5)) t1 $breaks [1] 1 2 3 4 5 $counts [1] 2 1 1 1 why is there 2 counts for 1? And should the counts be '1 1 1 1 1' ? It depends on the way the bins are defined. Had you forced

Re: [R] histogram

2009-10-08 Thread Rolf Turner
On 9/10/2009, at 8:47 AM, Khanh Nguyen wrote: Hi all, I have a question about hist() 1) t1 - hist(c(1,2,3,4,5)) t1 $breaks [1] 1 2 3 4 5 $counts [1] 2 1 1 1 why is there 2 counts for 1? RTFM --- include.lowest = TRUE and right = TRUE by default. And should the counts be '1 1

Re: [R] histogram

2009-10-08 Thread Ista Zahn
Or the right argument: t1 - hist(1:5, right=false) t1[1:2] $breaks [1] 1 2 3 4 5 $counts [1] 1 1 1 2 The issue has to do with what hist() does with the points that fall right on the break points. -Ista On Thu, Oct 8, 2009 at 3:58 PM, Henrique Dallazuanna www...@gmail.com wrote: Change the

Re: [R] histogram

2009-10-08 Thread David Scott
Henrique Dallazuanna wrote: Change the breaks argument: t1 - hist(1:5, 0:5) t1$counts On Thu, Oct 8, 2009 at 4:47 PM, Khanh Nguyen kngu...@cs.umb.edu wrote: Hi all, I have a question about hist() 1) t1 - hist(c(1,2,3,4,5)) t1 $breaks [1] 1 2 3 4 5 $counts [1] 2 1 1 1 why is there 2

Re: [R] histogram

2009-10-08 Thread Khanh Nguyen
I see ! Thank you everyone for the responses. -k On Thu, Oct 8, 2009 at 4:55 PM, David Scott d.sc...@auckland.ac.nz wrote: Henrique Dallazuanna wrote: Change the breaks argument: t1 - hist(1:5, 0:5) t1$counts On Thu, Oct 8, 2009 at 4:47 PM, Khanh Nguyen kngu...@cs.umb.edu wrote: Hi

Re: [R] Histogram problem

2009-08-21 Thread Petr PIKAL
Hi R does what you said to it it shall do! Without **reproducible** code and explanation what you did, what you get and what you **expect** to get it would be quite complicated task to understand what your code actually do. e.g. this for (i in 1:Count){ for (j in 1:Count2){

[R] Histogram problem

2009-08-20 Thread Conrad Addo
I'm trying to create a histogram from the following code, but my data keeps adding the Num vector and plotting that. My data in the CSV file is just one vector. Does anyone know why? Thanks Conrad SPXdf = data.frame(read.csv(file = SPX.csv, header = TRUE, sep = ,, dec = ., fill = TRUE)) Max

[R] histogram scaling

2009-08-19 Thread rajesh j
Hi, I'm drawing two histograms in the same plot.However, my point of comparison is the difference in their x coordinates.But my problem is one histogram is much taller than the other.How can I get them both to the same height? -- Rajesh.J [[alternative HTML version deleted]]

Re: [R] histogram scaling

2009-08-19 Thread Chris Friedl
Hey, Rajesh I bit light on detail here. Being a mind reader is not an R-help prerequisite. However since I have been working on histograms today and you've just posted a question using ggplot, let me guess that its ggplot you are refering to. Then here is an example, which you can find in my

[R] Histogram

2009-07-03 Thread aledanda
Hallo, How can I have the control of the width of each bin in the histogram? I would like to plot my data modifying the number and the width of the bins. Is there a good pdf or manual where i can learn to use the plot/hist in R very well? I find the help not always clear Thanks a lot Ale --

Re: [R] Histogram

2009-07-03 Thread Uwe Ligges
aledanda wrote: Hallo, How can I have the control of the width of each bin in the histogram? I would like to plot my data modifying the number and the width of the bins. Is there a good pdf or manual where i can learn to use the plot/hist in R very well? See ?hist and its argument breaks.

Re: [R] Histogram

2009-07-03 Thread Mark Knecht
On 7/3/09, aledanda danda.ga...@gmail.com wrote: Hallo, How can I have the control of the width of each bin in the histogram? I would like to plot my data modifying the number and the width of the bins. Is there a good pdf or manual where i can learn to use the plot/hist in R very

Re: [R] Histogram

2009-07-03 Thread Greg Snow
- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- project.org] On Behalf Of aledanda Sent: Friday, July 03, 2009 9:55 AM To: r-help@r-project.org Subject: [R] Histogram Hallo, How can I have the control of the width of each bin in the histogram? I would like to plot my data

Re: [R] histogram for time with format hh:mm

2009-06-18 Thread Allan Engelhardt
On 18/06/09 06:38, Shreyasee wrote: Hi, I have a dataset and calculated the time difference between two time variables. The output is somewhat like *1/29/2324 1:57:39 AM.* That is not a time difference you have calculated. (x-difftime(2009-12-31 12:00,2009-01-01 08:45)) # Time difference

Re: [R] histogram for time with format hh:mm

2009-06-18 Thread Shreyasee
Hi, The dataset has four time variables. Each variable has data in 1/6/2006 12:58:55 PM format. I applied the subtraction function (=E2-D2) for calculating difference between variable1 and variable2 for each record. I copied those values and pasted in another column using Paste special - values

Re: [R] histogram for time with format hh:mm

2009-06-18 Thread Allan Engelhardt
On 18/06/09 07:34, Shreyasee wrote: Hi, The dataset has four time variables. Each variable has data in 1/6/2006 12:58:55 PM format. I applied the subtraction function (=E2-D2) for calculating difference between variable1 and variable2 for each record. I copied those values and pasted in

[R] histogram for time with format hh:mm

2009-06-17 Thread Shreyasee
Hi, I have a dataset and calculated the time difference between two time variables. The output is somewhat like *1/29/2324 1:57:39 AM.* I want to plot a histogram for this variable. When I gave *hist()* command it returned an error saying *Error in hist.default(num) : 'x' must be numeric* Can

Re: [R] Histogram + % of cases for a given criteria

2009-05-14 Thread Jim Lemon
S. Nunes wrote: Hi all, I am doing some explorations using a dataset with the following structure (id, value, flag). For instance: a, 2.2, 1 b, 3.0, 1 c, 2.9, 0 d, 3.1, 1 ... I have plotted a standard histogram using a simple command like: hist(data$value) My question: I would like to

Re: [R] Histogram + % of cases for a given criteria

2009-05-14 Thread S. Nunes
Hi, Thanks for the contribution. I tested the code but I got a couple or errors. I'll try to debug these in the next days. Maybe there is a simpler approach to what I am trying to do. I have a bunch of measures and a column with the success of the case (1/0). I simply want to evaluate my

[R] Histogram + % of cases for a given criteria

2009-05-13 Thread S. Nunes
Hi all, I am doing some explorations using a dataset with the following structure (id, value, flag). For instance: a, 2.2, 1 b, 3.0, 1 c, 2.9, 0 d, 3.1, 1 ... I have plotted a standard histogram using a simple command like: hist(data$value) My question: I would like to superimpose a line

[R] Histogram + % of cases for a given criteria

2009-05-13 Thread S. Nunes
Hi all, I am doing some explorations using a dataset with the following structure (id, value, flag). For instance: a, 2.2, 1 b, 3.0, 1 c, 2.9, 0 d, 3.1, 1 ... I have plotted a standard histogram using a simple command like: hist(data$value) My question: I would like to superimpose a line

Re: [R] Histogram frequencies with a normal pdf curve overlay

2009-05-11 Thread Greg Snow
Sent: Saturday, May 09, 2009 11:04 AM To: ted.hard...@manchester.ac.uk Cc: r-help@r-project.org Subject: Re: [R] Histogram frequencies with a normal pdf curve overlay Thank you! On Sat, May 9, 2009 at 11:31 AM, Ted Harding ted.hard...@manchester.ac.uk wrote: On 09-May-09 16:10:42, Jacques

[R] Histogram frequencies with a normal pdf curve overlay

2009-05-09 Thread Jacques Wagnor
Dear List, When I plot a histogram with 'freq=FALSE' and overlay the histogram with a normal pdf curve, everything looks as expected, as follows: x - rnorm(1000) hist(x, freq=FALSE) curve(dnorm(x), add=TRUE, col=blue) What do I need to do if I want to show the frequencies (freq=TRUE) with the

Re: [R] Histogram frequencies with a normal pdf curve overlay

2009-05-09 Thread Ted Harding
On 09-May-09 16:10:42, Jacques Wagnor wrote: Dear List, When I plot a histogram with 'freq=FALSE' and overlay the histogram with a normal pdf curve, everything looks as expected, as follows: x - rnorm(1000) hist(x, freq=FALSE) curve(dnorm(x), add=TRUE, col=blue) What do I need to do if

Re: [R] Histogram frequencies with a normal pdf curve overlay

2009-05-09 Thread Jacques Wagnor
Thank you! On Sat, May 9, 2009 at 11:31 AM, Ted Harding ted.hard...@manchester.ac.uk wrote: On 09-May-09 16:10:42, Jacques Wagnor wrote: Dear List, When I plot a histogram with 'freq=FALSE' and overlay the histogram with a normal pdf curve, everything looks as expected, as follows: x -

Re: [R] Histogram frequencies with a normal pdf curve overlay

2009-05-09 Thread S Ellison
Assuming a constant bin width, you need to multiply the density by n*binwidth, where the bin width is (obviously!) the width of the histogram bins. Jacques Wagnor jacques.wag...@gmail.com 05/09/09 5:10 PM Dear List, When I plot a histogram with 'freq=FALSE' and overlay the histogram with a

[R] Histogram and moving average

2009-04-14 Thread Vallat Morgan
Hi everyone, I have a 'basic' issue and hope someone has a bit of code to solve it. I have two populations plotted as histograms on the same figure. Basically I want to add the moving average (based on hist) for both populations on my graph. I'm also interested in the x coordinate of the curves

Re: [R] Histogram and moving average

2009-04-14 Thread Dieter Menne
Vallat Morgan morgan.vallat at epfl.ch writes: I have a 'basic' issue and hope someone has a bit of code to solve it. I have two populations plotted as histograms on the same figure. Basically I want to add the moving average (based on hist) for both populations on my graph. I'm also

[R] Histogram with lattice with two 'conditional' variables

2009-04-02 Thread Judith Flores
Hello dear R-community, I have been trying to figure out a way to generate histograms of a numeric variable observed in different entities ('individual' below). Each one of this entities is classified as A or B (according to the pseudo-code below): variable-sample(rep(1:10,10))

Re: [R] Histogram with lattice with two 'conditional' variables

2009-04-02 Thread Deepayan Sarkar
On Thu, Apr 2, 2009 at 3:16 PM, Judith Flores jur...@yahoo.com wrote: Hello dear R-community,    I have been trying to figure out a way to generate histograms of a numeric variable observed in different entities ('individual' below). Each one of this entities is classified as A or B

[R] histogram plots with many different samples

2009-03-25 Thread evrim akar
Dear R users, I would like to draw some histograms as seen in the page whose address I wrote below. I searched through the web a lot and I found a page which describes how I can do it for older versions of R. For newer versions they recommend to install the package R.basics in R.clusters but this

Re: [R] histogram plots with many different samples

2009-03-25 Thread ONKELINX, Thierry
- Van: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Namens evrim akar Verzonden: woensdag 25 maart 2009 15:40 Aan: r-help@r-project.org Onderwerp: [R] histogram plots with many different samples Dear R users, I would like to draw some histograms as seen in the page whose

Re: [R] histogram plots with many different samples

2009-03-25 Thread Gabor Grothendieck
Google for R.classes bundle which will get you to the appropriate page on the author's site where you can download and install it. Installing the bundle will install a number of packages including R.basic which contains plot.histogram. On Wed, Mar 25, 2009 at 10:40 AM, evrim akar

Re: [R] histogram plots with many different samples

2009-03-25 Thread Greg Snow
greg.s...@imail.org 801.408.8111 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- project.org] On Behalf Of evrim akar Sent: Wednesday, March 25, 2009 8:40 AM To: r-help@r-project.org Subject: [R] histogram plots with many different samples Dear R users

Re: [R] histogram plots with many different samples

2009-03-25 Thread hadley wickham
- project.org] On Behalf Of evrim akar Sent: Wednesday, March 25, 2009 8:40 AM To: r-help@r-project.org Subject: [R] histogram plots with many different samples Dear R users, I would like to draw some histograms as seen in the page whose address I wrote below. I searched through the web a lot

Re: [R] histogram plots with many different samples

2009-03-25 Thread Jason Rupert
Check out: ggplot2 (http://had.co.nz/ggplot2/) This R library is also good at developing histograms. Good luck. --- On Wed, 3/25/09, evrim akar evrim.a...@gmail.com wrote: From: evrim akar evrim.a...@gmail.com Subject: [R] histogram plots with many different samples To: r-help@r

[R] Histogram height

2009-02-01 Thread Brendan Cusick
Hello. I have what I'm sure is a very simple question. Hopefully someone can help. I can't seem to find the maximum height of a histogram. In matlab it would be simple to say max(hist(x, 100)), but this doesn't seem to work in R. Any input would be greatly appreciated. Brendan

Re: [R] Histogram height

2009-02-01 Thread Jim Lemon
Brendan Cusick wrote: Hello. I have what I'm sure is a very simple question. Hopefully someone can help. I can't seem to find the maximum height of a histogram. In matlab it would be simple to say max(hist(x, 100)), but this doesn't seem to work in R. Any input would be greatly appreciated.

Re: [R] Histogram height

2009-02-01 Thread Brendan Cusick
Jim, you are a genius. Thanks for the help. Brendan On Sun, Feb 1, 2009 at 5:44 AM, Jim Lemon j...@bitwrit.com.au wrote: Brendan Cusick wrote: Hello. I have what I'm sure is a very simple question. Hopefully someone can help. I can't seem to find the maximum height of a histogram. In

Re: [R] Histogram for grouped data in R

2009-01-25 Thread Mendiburu, Felipe (CIP)
-project.org Subject: [R] Histogram for grouped data in R I have grouped data in this format Size -- Count 0-10 -- 15 10-20 -- 25 20-50 -- 10 50-100 -- 5 I've been trying to find a way to set this up with the proper histogram heights, but can't seem to figure it out. So any help would be much

Re: [R] Histogram for grouped data in R

2009-01-25 Thread Mendiburu, Felipe (CIP)
From: r-help-boun...@r-project.org on behalf of Vincent Goulet Sent: Fri 1/23/2009 10:36 AM To: darthgervais Cc: r-help@r-project.org Subject: Re: [R] Histogram for grouped data in R Le ven. 23 janv. à 08:55, darthgervais a écrit : I have grouped data

Re: [R] Histogram for grouped data in R

2009-01-24 Thread Yonathan (Jon) Anson
The category widths are not equal. Surely, what you mean is: x - c(15,25,rep(10/3,3),rep(5/5, 5)) names(x) - c('0-10','10-20','','20-50',rep('',3), '50-100', '', '') barplot(x,space=0, xlab='Size', ylab='Count', border = NA, col=c(1,2, rep(3,3), rep(4,5))) :-) Jon Anson Jorge Ivan Velez

[R] Histogram for grouped data in R

2009-01-23 Thread darthgervais
I have grouped data in this format Size -- Count 0-10 -- 15 10-20 -- 25 20-50 -- 10 50-100 -- 5 I've been trying to find a way to set this up with the proper histogram heights, but can't seem to figure it out. So any help would be much appreciated! -- View this message in context:

Re: [R] Histogram for grouped data in R

2009-01-23 Thread Vincent Goulet
Le ven. 23 janv. à 08:55, darthgervais a écrit : I have grouped data in this format Size -- Count 0-10 -- 15 10-20 -- 25 20-50 -- 10 50-100 -- 5 I've been trying to find a way to set this up with the proper histogram heights, but can't seem to figure it out. So any help would be much

Re: [R] Histogram for grouped data in R

2009-01-23 Thread Jorge Ivan Velez
Hi, Try this: x-c(15,25,10,5) names(x)-c('0-10','10-20','20-50','50-100') barplot(x,space=0,xlab='Size',ylab='Count',col=1:4) See ?barplot for more information. HTH, Jorge On Fri, Jan 23, 2009 at 8:55 AM, darthgervais darthgerv...@yahoo.ca wrote: I have grouped data in this format Size

Re: [R] histogram without bars but with density line - frequency-lines?

2008-10-17 Thread Yihui Xie
Bars are corresponding to bins, and the bin-width for lines is 0; please tell me what is the frequency at a fixed point (rather than over an interval)? Regards, Yihui -- Yihui Xie [EMAIL PROTECTED] Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-15810805877 Homepage:

[R] histogram without bars but with density line

2008-10-16 Thread Jörg Groß
Hi, I know how to plot an histogram and how to add a density line. But how can I plot only the density line without the bars? Is there a way to say the hist() function not to plot bars, but a density line instead? __ R-help@r-project.org mailing

Re: [R] histogram without bars but with density line

2008-10-16 Thread Yihui Xie
plot(density(x)) Regards, Yihui -- Yihui Xie [EMAIL PROTECTED] Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-15810805877 Homepage: http://www.yihui.name School of Statistics, Room 1037, Mingde Main Building, Renmin University of China, Beijing, 100872, China On Thu, Oct 16,

Re: [R] histogram without bars but with density line - frequency-lines?

2008-10-16 Thread Jörg Groß
Am 16.10.2008 um 17:12 schrieb Yihui Xie: plot(density(x)) Regards, Yihui -- Thanks! Is there also a way to plot the frequency-bars (not the density) as lines instead of bars? __ R-help@r-project.org mailing list

Re: [R] histogram loses top row with alpha transparency under Windows

2008-10-14 Thread Prof Brian Ripley
I *presume* this is the windows() device in a current version of R, but you failed to tell us almost any of the information requested in the posting guide. If so, you are seeing how Windows GDI copying operations work: if the region to be copied goes off-window, they clip the region

Re: [R] histogram loses top row with alpha transparency under Windows

2008-10-14 Thread Keith Ponting
Thankyou for your response. From: Prof Brian Ripley [mailto:[EMAIL PROTECTED] Sent: 14 October 2008 12:09 To: Keith Ponting Cc: [EMAIL PROTECTED]; r-help@r-project.org Subject: Re: [R] histogram loses top row with alpha transparency under Windows I *presume* this is the windows() device

Re: [R] histogram loses top row with alpha transparency under Windows

2008-10-10 Thread Keith Ponting
Richard.Cotton wrote: The rectangles being drawn extend higher than the top of the panel. (Your y axis ranges from 0 to 50, but the bars go up to 100.) Thankyou - I can also make the bars on the lower panels vanish by tinkering with ylim. In the top row of plots, depending upon the shape

Re: [R] histogram loses top row with alpha transparency under Windows

2008-10-09 Thread Richard Cotton
k.ponting wrote: Hello all. Trying to use transparency for overlaid histogram plots I have come across an interesting inconsistency, possibly a bug when running under Windows. Originally noticed in R 2.7.1, it is still there in 2.8.0 beta. library(lattice) zz - function(n,alpha) {

[R] histogram loses top row with alpha transparency under Windows

2008-10-08 Thread Keith Ponting
Hello all. Trying to use transparency for overlaid histogram plots I have come across an interesting inconsistency, possibly a bug when running under Windows. Originally noticed in R 2.7.1, it is still there in 2.8.0 beta. library(lattice) zz - function(n,alpha) { ranges - NULL for(ds in

Re: [R] Histogram colours in lattice.

2008-10-08 Thread Rolf Turner
On 8/10/2008, at 5:16 PM, Deepayan Sarkar wrote: On 10/7/08, Rolf Turner [EMAIL PROTECTED] wrote: I am trying to do a histogram lattice plot and I would like the histogram to be filled with a different colour in each panel. Note: I want every bar in each histogram to be the same colour,

Re: [R] Histogram colours in lattice.

2008-10-08 Thread Deepayan Sarkar
On Wed, Oct 8, 2008 at 12:15 PM, Rolf Turner [EMAIL PROTECTED] wrote: On 8/10/2008, at 5:16 PM, Deepayan Sarkar wrote: On 10/7/08, Rolf Turner [EMAIL PROTECTED] wrote: I am trying to do a histogram lattice plot and I would like the histogram to be filled with a different colour in each

[R] Histogram colours in lattice.

2008-10-07 Thread Rolf Turner
I am trying to do a histogram lattice plot and I would like the histogram to be filled with a different colour in each panel. Note: I want every bar in each histogram to be the same colour, but that there should be different colours *between* histograms. Can't seem to get this to work. I

Re: [R] Histogram colours in lattice.

2008-10-07 Thread hadley wickham
On Tue, Oct 7, 2008 at 8:54 PM, Rolf Turner [EMAIL PROTECTED] wrote: I am trying to do a histogram lattice plot and I would like the histogram to be filled with a different colour in each panel. Note: I want every bar in each histogram to be the same colour, but that there should be

Re: [R] histogram-like plot - multiple bars side by side *solved*

2008-09-30 Thread Jörg Groß
Data Center Intermountain Healthcare [EMAIL PROTECTED] 801.408.8111 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] project.org] On Behalf Of Jörg Groß Sent: Monday, September 29, 2008 2:06 PM To: r-help@r-project.org Subject: [R] histogram-like plot - multiple bars side

Re: [R] histogram-like plot with two variables

2008-09-29 Thread Duncan Murdoch
On 28/09/2008 10:02 PM, Jörg Groß wrote: Hi, I want to plot a binomial propability distribution. I know how to generate the data; x - seq(from=0, to=14, by=1) y - dbinom(x, 14, 0.7, log = FALSE) but what I don't know is how to plot this within a histogram like plot. Because the

Re: [R] histogram-like plot with two variables

2008-09-29 Thread Jim Lemon
Jörg Groß wrote: Hi, I want to plot a binomial propability distribution. I know how to generate the data; x - seq(from=0, to=14, by=1) y - dbinom(x, 14, 0.7, log = FALSE) but what I don't know is how to plot this within a histogram like plot. Because the histogram function only accepts

Re: [R] histogram-like plot with two variables

2008-09-29 Thread Philipp Pagel
On Mon, Sep 29, 2008 at 04:02:05AM +0200, Jörg Groß wrote: Hi, I want to plot a binomial propability distribution. I know how to generate the data; x - seq(from=0, to=14, by=1) y - dbinom(x, 14, 0.7, log = FALSE) I tried: plot(x,y, type=h) but the bars are very thin -is

Re: [R] histogram-like plot with two variables

2008-09-29 Thread Greg Snow
] 801.408.8111 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] project.org] On Behalf Of Philipp Pagel Sent: Monday, September 29, 2008 5:40 AM To: r-help@r-project.org Subject: Re: [R] histogram-like plot with two variables On Mon, Sep 29, 2008 at 04:02:05AM

[R] histogram-like plot - multiple bars side by side

2008-09-29 Thread Jörg Groß
Hi, I found this example for producing multiple histograms; require(plotrix) l - list(rnorm(50),rnorm(50,sd=2),rnorm(50,mean=3)) multhist(l) Now I want something like that, for creating multiple density distributions (in one plot). But I have two variables for one density distribution

Re: [R] histogram-like plot - multiple bars side by side

2008-09-29 Thread Greg Snow
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] project.org] On Behalf Of Jörg Groß Sent: Monday, September 29, 2008 2:06 PM To: r-help@r-project.org Subject: [R] histogram-like plot - multiple bars side by side Hi, I found this example for producing multiple

[R] histogram-like plot with two variables

2008-09-28 Thread Jörg Groß
Hi, I want to plot a binomial propability distribution. I know how to generate the data; x - seq(from=0, to=14, by=1) y - dbinom(x, 14, 0.7, log = FALSE) but what I don't know is how to plot this within a histogram like plot. Because the histogram function only accepts one variable. Is

Re: [R] histogram-like plot with two variables

2008-09-28 Thread jim holtman
Try: plot(x,y,type='s') lines(x,y, type='h') On Sun, Sep 28, 2008 at 10:02 PM, Jörg Groß [EMAIL PROTECTED] wrote: Hi, I want to plot a binomial propability distribution. I know how to generate the data; x - seq(from=0, to=14, by=1) y - dbinom(x, 14, 0.7, log = FALSE) but what I

Re: [R] histogram

2008-09-15 Thread Jim Lemon
Felipe wrote: i calculated the density and wanna do something like this separate in 0-19-29-39-49-59-69-79-99 and put in these spaces 8 densities .. 0.something i have the frequency in % and divided already in 20 or 10 to get the density i tried and tried..made breaks vector to separate but

[R] histogram

2008-09-14 Thread Felipe
i calculated the density and wanna do something like this separate in 0-19-29-39-49-59-69-79-99 and put in these spaces 8 densities .. 0.something i have the frequency in % and divided already in 20 or 10 to get the density i tried and tried..made breaks vector to separate but couldn't put the

[R] Histogram binning

2008-08-19 Thread Ben Cox
I am trying to produce frequencies in defined intervals however I can't seem to figure out how to get R to bin my data the way I want it to. I have several thousand lengths of fish that I want to be binned as follows: Ex. Length Bin 209 200 219 210 431

Re: [R] Histogram binning

2008-08-19 Thread jim holtman
Is this what you want: cuts - c(0,209,429,719,1500) x - runif(1000,0,1447) barplot(table(cut(x, breaks=cuts))) On Tue, Aug 19, 2008 at 4:17 PM, Ben Cox [EMAIL PROTECTED] wrote: I am trying to produce frequencies in defined intervals however I can't seem to figure out how to get R to bin my

[R] histogram - freq=FALSE - density computation

2008-08-07 Thread Jörg Groß
Hi, I don't understand what hist(x, freq=FALSE) does. At first I thought it would be just the relative frequencies instead of the absolute frequencies, by just computing frequencies / n in every category. But with a small dataset the y-values (densities) don't sum to one. Is there a way

Re: [R] histogram - freq=FALSE - density computation

2008-08-07 Thread Duncan Murdoch
On 07/08/2008 6:55 PM, Jörg Groß wrote: Hi, I don't understand what hist(x, freq=FALSE) does. At first I thought it would be just the relative frequencies instead of the absolute frequencies, by just computing frequencies / n in every category. But with a small dataset the y-values

[R] Histogram

2008-07-23 Thread Angelo Scozzarella
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 Thanks Angelo Scozzarella

Re: [R] Histogram

2008-07-23 Thread milton ruser
I don´t know what you means by treat, but may be you want something like my.df-read.table(stdin(), head=T, sep=,) class,frequency 20-23,9 23-25,7 26-28,5 29-31,5 32-34,3 rownames(my.df)-my.df$class barplot (my.df$frequency) axis(1, 1:dim(my.df)[1], rownames(my.df)) Cheers, miltinho astronauta

Re: [R] Histogram

2008-07-23 Thread Henrique Dallazuanna
Try this: with(x, barplot(frequency, names.arg = class)) On Wed, Jul 23, 2008 at 3:29 PM, Angelo Scozzarella [EMAIL PROTECTED] wrote: Hi, how can I treat data organised in classes and frequencies? Ex. class frequency 20-23 9 23-25 7 26-28

Re: [R] Histogram

2008-07-23 Thread Mark Difford
Hi Angelo, Look carefully at package vcd; and at log-linear models (+ glm(..., family=poisson)). For overdispersion there are more advanced methods. HTH, Mark. Angelo Scozzarella wrote: Hi, how can I treat data organised in classes and frequencies? Ex. class frequency

Re: [R] Histogram

2008-07-23 Thread milton ruser
Try see doBy package. Below you have a code on brute force. kind regards, miltinho brazil === number.of.records-20 my.df-data.frame(v1=sample(21:34,number.of.records, replace=T), v2=runif(number.of.records), v3=runif(number.of.records)) my.df$v1-as.numeric(as.character(my.df$v1))

<    1   2   3   4   >