[R] Histogram

2007-08-31 Thread squall44
Hello, Although I've done lots of research on histograms, I'm still not able to create one. I'd be glad if someone could explain them to me. That's what it eventually should look like: http://www.nabble.com/file/p12423193/histogram.gif The interval limits are: (0), 1, 2, 3, 3.5, 4.5, 5, 5.5,

Re: [R] Histogram

2007-08-31 Thread Gustaf Rydevik
On 8/31/07, squall44 [EMAIL PROTECTED] wrote: Hello, Although I've done lots of research on histograms, I'm still not able to create one. I'd be glad if someone could explain them to me. That's what it eventually should look like: http://www.nabble.com/file/p12423193/histogram.gif The

[R] Histogram Title SizeFont

2007-08-29 Thread livia
Hello, I would like to plot a histogram with title Return, and I would like the font for the title to be Bold and the size to be 8( as in Excel). I tried the following code, but it does not make any change. Could anyone give me some advice? hist (preturn, seq(-0.05,0.05,0.005),freq = FALSE,

Re: [R] Histogram Title SizeFont

2007-08-29 Thread Uwe Ligges
livia wrote: Hello, I would like to plot a histogram with title Return, and I would like the font for the title to be Bold and the size to be 8( as in Excel). I tried the following code, but it does not make any change. Could anyone give me some advice? See ?par. Uwe Ligges hist

[R] Histogram

2007-08-23 Thread squall44
Hello, I wanted to create a histogram, but somehow I got stuck... The interval limits are: x = 1, 2, 3, 3.5, 4.5, 5, 5.5 The interval widths are therefore: 1, 1, 0.5, 1, 0.5, 0.5 Nothing I tried worked... Can anyone help me please? Thanks Tobias -- View this message in context:

Re: [R] Histogram

2007-08-23 Thread Uwe Ligges
squall44 wrote: Hello, I wanted to create a histogram, but somehow I got stuck... The interval limits are: x = 1, 2, 3, 3.5, 4.5, 5, 5.5 The interval widths are therefore: 1, 1, 0.5, 1, 0.5, 0.5 Please read the help page more carefully! See ?hist and its argument breaks. Uwe Ligges

Re: [R] Histogram

2007-08-23 Thread squall44
Well, that was the first thing I tried. But the help only gives you the commands and does not explain how to use it (I am a newbe). How do I use the argument 'breaks'? I tried: #--- x = c(1, 2, 3, 3.5, 4.5, 5, 5.5) breaks=c(1, 1, 0.5, 1, 0.5, 0.5) hist(x, breaks= breaks, xlim=c(0,7),

Re: [R] Histogram

2007-08-23 Thread Uwe Ligges
squall44 wrote: Well, that was the first thing I tried. But the help only gives you the commands and does not explain how to use it (I am a newbe). How do I use the argument 'breaks'? I tried: #--- x = c(1, 2, 3, 3.5, 4.5, 5, 5.5) breaks=c(1, 1, 0.5, 1, 0.5, 0.5) hist(x, breaks=

Re: [R] histogram with absolute figures

2007-07-10 Thread Mark Difford
In the absence of a data set, it may help to read the help file carefully: ?hist Note, in particular, that the argument freq defaults to TRUE if and only if breaks are equidistant (and probability is not specified). Regards, Mark. Sarah Goslee wrote: Well, how about an example of what you

Re: [R] histogram with absolute figures

2007-07-09 Thread Mag. Ferri Leberl
Meanwhile I have recognized, that the breaks-option enforces density as the default. But if I try to force frequencies (freq=TRUE) I get the following feedback: Warning message: the AREAS in the plot are wrong -- rather use freq=FALSE in: plot.histogram(r, freq = freq, col = col, border = border,

Re: [R] histogram with absolute figures

2007-07-09 Thread Sarah Goslee
Well, how about an example of what you are doing, and a description of what the results you get and the results you want are? When I do a histogram, I get frequencies. Sarah On 7/9/07, Mag. Ferri Leberl [EMAIL PROTECTED] wrote: Meanwhile I have recognized, that the breaks-option enforces

[R] histogram with absolute figures

2007-07-06 Thread Mag. Ferri Leberl
Dear everybody! Is ist easily possible to make up a histogram with absolute numbers instead of percentages? Thank you in advance! Yours, Mag. Ferri Leberl __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do

Re: [R] histogram with absolute figures

2007-07-06 Thread Sarah Goslee
The default of hist() is counts rather than percentages. Sarah On 7/6/07, Mag. Ferri Leberl [EMAIL PROTECTED] wrote: Dear everybody! Is ist easily possible to make up a histogram with absolute numbers instead of percentages? Thank you in advance! Yours, Mag. Ferri Leberl

[R] Histogram

2007-06-19 Thread livia
Hello, I am using the following codes to plot a histogram and density line for x. For the density line, I just want it to show the two tails, eg, for x larger than 0.05 ans smaller than -0.05 hist (x, seq(-0.1,0.1,0.01),freq = FALSE) lines (density(x,bw=SJ), x 0.05 x (-0.05), col = red) But is

Re: [R] Histogram

2007-06-19 Thread David Barron
I expect there's a more elegant way of doing this, but this should work: set.seed(101) x - rnorm(500,sd=.03) hist (x, seq(-0.1,0.1,0.01),freq = FALSE) d - density(x,bw=SJ) lowt - d$x -.05 upt - d$x .05 lines (d$x[lowt],d$y[lowt], col = red) lines(d$x[upt],d$y[upt], col = red) On 19/06/07,

Re: [R] Histogram

2007-06-19 Thread John Kane
Your subsetting expression in lines does not make any sense at all. Not tested but maybe something like: lines (density(subset(x, x 0.05 x -0.05)bw=SJ), col='red) --- livia [EMAIL PROTECTED] wrote: Hello, I am using the following codes to plot a histogram and density line for x. For the

[R] Histogram using frequency data

2007-06-18 Thread suman Duvvuru
Hello, I wanted to know how to plot a histogram using a vector of frequencies rather than the data vector as a whole. So I have two vectors: a vector of labels V1= c(A,B,C,D) and vector B which is a vector of frequencies of A, B, C and D respectively V2=c(20,50,60,30). I wanted to plot a

Re: [R] Histogram using frequency data

2007-06-18 Thread Marc Schwartz
On Mon, 2007-06-18 at 19:40 -0400, suman Duvvuru wrote: Hello, I wanted to know how to plot a histogram using a vector of frequencies rather than the data vector as a whole. So I have two vectors: a vector of labels V1= c(A,B,C,D) and vector B which is a vector of frequencies of A, B, C

[R] Histogram with uneven bins

2007-04-19 Thread mtb954
Hi R-helpers I would like to produce a histogram with uneven bins (e.g., 0, 1-2, 3-5, 6-10, 10-20, 20) but I would like the resulting bars to be the same width ( i.e., a bar's width would not be proportional to its corresponding bin size). Also, the x and y axes of my histograms frequently

Re: [R] Histogram with uneven bins

2007-04-19 Thread jim holtman
will this work for you? x - runif(1000, 0, 40) x.c - cut(x, breaks=c(0, 1, 3, 6, 10, Inf)) barplot(table(x.c)) On 4/19/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi R-helpers I would like to produce a histogram with uneven bins (e.g., 0, 1-2, 3-5, 6-10, 10-20, 20) but I would like the

[R] Histogram of ones.

2007-02-06 Thread Dong H. Oh
Dear expeRts, I'd like to picture histogram of ones. For example, hist(rep(1, 100), col=lightblue, border=black) A bin is pictured ranging on [0,1] and range of x axis is also [0,1]. How can I adjust the bin range from [0,1] to [0.9, 1] ? I am looking forward to hearing from expeRt.

Re: [R] Histogram of ones.

2007-02-06 Thread talepanda
If I correctly understand, hist(rep(1, 100), col=lightblue, border=black,breaks=0:10*0.1) see: breaks arg in ?hist On 2/7/07, Dong H. Oh [EMAIL PROTECTED] wrote: Dear expeRts, I'd like to picture histogram of ones. For example, hist(rep(1, 100), col=lightblue, border=black) A bin is

[R] histogram bin width

2006-11-06 Thread Leeds, Mark \(IED\)
hi all : i have the data below and then below that, i call the hist function three times using the Scott method for the widths of the bins. the bin width is different for the three histograms but I would like it to always be 0.05 regfardless of the data set being histogrammed. I'm sure there

Re: [R] histogram bin width

2006-11-06 Thread Francisco Zagmutt
There are several ways to do this, probably the easiest is to use truehist from MASS. i.e require(MASS) par(mfrow=c(3,1)) #3 rows of histograms, one column truehist(x,h=.05) truehist(y,h=.05) truehist(z,h=.05) I hope this helps, Francisco -- Dr. Francisco J. Zagmutt College of Veterinary

[R] Histogram

2006-09-27 Thread Mohsen Jafarikia
Dear all, I want to design a histogram and I need to have the frequency at certain points. For example I have the following 2 columns: *X Y* 0.125 0.422 0.45 11 0.55 21 I want the chart to have 4 columns. First column is from 0.0-0.1 (on X) and frequency is 25. Next colum is

Re: [R] Histogram

2006-09-27 Thread Ritwik Sinha
Hi, There may be an easier way but here is one way you can do it. # create vector that has Y[i] X[i]s new.data - rep(X,Y) hist(new.data, breaks=c(0,.1,.4,.6)) # or something like that look at what exactly breaks should be. Ritwik. On 9/27/06, Mohsen Jafarikia [EMAIL PROTECTED] wrote: Dear

Re: [R] Histogram

2006-09-27 Thread Marc Schwartz
On Wed, 2006-09-27 at 18:29 -0400, Mohsen Jafarikia wrote: Dear all, I want to design a histogram and I need to have the frequency at certain points. For example I have the following 2 columns: *X Y* 0.125 0.422 0.45 11 0.55 21 I want the chart to have 4 columns.

[R] histogram colors in lattice

2006-09-26 Thread Jamie Jarabek
I have code that constructs a plot using the lattice package that looks something like the following toy example: library(lattice) Start - factor(rbinom(100,1,.5)) Answer - 2 - rbinom(100,1,.7) histogram(~Answer | Start, breaks=c(1, 1.4 ,1.6,2),

Re: [R] histogram colors in lattice

2006-09-26 Thread Gabor Grothendieck
Try this: library(lattice) set.seed(1) ## added for reproducibility Start - factor(rbinom(100,1,.5)) Answer - 2 - rbinom(100,1,.7) histogram(~Answer | Start, breaks=c(1, 1.4 ,1.6,2), scales=list(x=list(at=c(1.2,1.8),labels=c(Yes,No))), panel = function(x, ...,

[R] histogram frequency weighing

2006-09-17 Thread Sebastian P. Luque
Fellow R-helpers, Suppose we create a histogram as follows (although it could be any vector with zeroes in it): R lenh - hist(iris$Sepal.Length, br=seq(4, 8, 0.05)) R lenh$counts [1] 0 0 0 0 0 1 0 3 0 1 0 4 0 2 0 5 0 6 0 10 0 9 0 4 0 [26] 1 0 6 0 7 0 6 0 8 0

Re: [R] histogram frequency weighing

2006-09-17 Thread jim holtman
I think this should do it: lenh - hist(iris$Sepal.Length, br=seq(4, 8, 0.05))$counts lenh # original data [1] 0 0 0 0 0 1 0 3 0 1 0 4 0 2 0 5 0 6 0 10 0 9 0 4 0 1 0 6 0 7 0 6 0 [34] 8 0 7 0 3 0 6 0 6 0 4 0 9 0 7 0 5 0 2 0 8 0 3 0 4 0

Re: [R] histogram frequency weighing

2006-09-17 Thread Sebastian P. Luque
On Sun, 17 Sep 2006 15:12:30 -0500, Sebastian P. Luque [EMAIL PROTECTED] wrote: [...] I thought about some very contrived ways to accomplish this, involving 'which' and 'diff', but I sense a function might already be available to do this efficiently. I think I found a better combination of

Re: [R] histogram frequency weighing

2006-09-17 Thread Sebastian P. Luque
On Sun, 17 Sep 2006 18:05:15 -0400, jim holtman [EMAIL PROTECTED] wrote: I think this should do it: [...] Thank you Jim, the idea with 'rle' is great. I missed your follow-up before mine a minute ago with another solution. I'll do some testing with both. Cheers, -- Seb

[R] Histogram of data with categorical varialbe

2006-09-15 Thread Alexandre Depire
Hello, I have the following data: Km Sex 250 1 300 2 290 2 600 1 450 2 650 1 . I would like to obtain one histogram where the data (or the part) of each sex is visible, it is like cumulative histogram or spinogram. To be more comprehensible, i would like to know if the following graph is

Re: [R] Histogram of data with categorical varialbe

2006-09-15 Thread Romain Francois
Alexandre Depire wrote: Hello, I have the following data: Km Sex 250 1 300 2 290 2 600 1 450 2 650 1 . I would like to obtain one histogram where the data (or the part) of each sex is visible, it is like cumulative histogram or spinogram. To be more comprehensible, i would

Re: [R] Histogram of data with categorical varialbe

2006-09-15 Thread Achim Zeileis
On Fri, 15 Sep 2006 16:45:31 +0200 Alexandre Depire wrote: Hello, I have the following data: Km Sex 250 1 300 2 290 2 600 1 450 2 650 1 . I would like to obtain one histogram where the data (or the part) of each sex is visible, it is like cumulative histogram or spinogram.

[R] histogram in the background?

2006-09-06 Thread gallon li
I intend to draw a plot of y against x. In the background of this graph I wish to creat a histogram of the horizontal variable x. Does any expert know how to produce such a plot? [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch

Re: [R] histogram in the background?

2006-09-06 Thread JeeBee
How about this? http://addictedtor.free.fr/graphiques/RGraphGallery.php?graph=78 JeeBee On Wed, 06 Sep 2006 18:19:28 +0800, gallon li wrote: I intend to draw a plot of y against x. In the background of this graph I wish to creat a histogram of the horizontal variable x. Does any expert

Re: [R] histogram in the background?

2006-09-06 Thread JeeBee
gallon li wrote: I have found this one before. However, my intension is slightly differing from this plot: I wish to plot the histogram in the backgroun instead of in the margin. Thanks anyway! On Wed, 06 Sep 2006 12:29:51 +0200, JeeBee wrote: How about this?

Re: [R] histogram in the background?

2006-09-06 Thread John Kane
--- JeeBee [EMAIL PROTECTED] wrote: gallon li wrote: I have found this one before. However, my intension is slightly differing from this plot: I wish to plot the histogram in the backgroun instead of in the margin. Thanks anyway! On Wed, 06 Sep 2006 12:29:51 +0200, JeeBee wrote:

Re: [R] histogram in the background?

2006-09-06 Thread hadley wickham
I intend to draw a plot of y against x. In the background of this graph I wish to creat a histogram of the horizontal variable x. Does any expert know how to produce such a plot? When constructing such a plot, you need to be careful that you don't end up constructing a pretty picture instead

[R] histogram breaks as labels

2006-05-08 Thread Albert Vilella
Hi all, I would like to know if there is a way to have the diplay the breaks of the hist (as myhist$breaks here in the example) as the labels, instead of the myhist$counts: input = rpois(1000,5) myhist = hist(input, breaks = 15, labels=TRUE, axes=FALSE) So that, instead of having: 94 140 187

Re: [R] histogram breaks as labels

2006-05-08 Thread Dimitris Rizopoulos
@stat.math.ethz.ch Sent: Monday, May 08, 2006 2:01 PM Subject: [R] histogram breaks as labels Hi all, I would like to know if there is a way to have the diplay the breaks of the hist (as myhist$breaks here in the example) as the labels, instead of the myhist$counts: input = rpois(1000,5

Re: [R] histogram breaks as labels

2006-05-08 Thread Albert Vilella
[EMAIL PROTECTED] To: r-help@stat.math.ethz.ch Sent: Monday, May 08, 2006 2:01 PM Subject: [R] histogram breaks as labels Hi all, I would like to know if there is a way to have the diplay the breaks of the hist (as myhist$breaks here in the example) as the labels, instead of the myhist

[R] Histogram to compare two datasets

2006-04-21 Thread Johan van Niekerk
Dear All, I am trying to create a histogram-like plot for comparing two datasets - For each interval, I want it to draw 2 bars - one for representing the number of values in each dataset for that interval. I have looked at the help for the hist() function and also for the histogram() function

Re: [R] Histogram to compare two datasets

2006-04-21 Thread Romain Francois
Le 21.04.2006 10:48, Johan van Niekerk a écrit : Dear All, I am trying to create a histogram-like plot for comparing two datasets - For each interval, I want it to draw 2 bars - one for representing the number of values in each dataset for that interval. I have looked at the help for the

[R] histogram error: 'x' must be numeric

2006-02-10 Thread jia ding
Hi All, I have problem to plot histogram. What I did is: export a .csv file from PSQL database's table. so, inside this .csv file it looks like: 31.845 24.598 29.1223 24.715 23.1847 24.2321 25.2995 23.4261 30.7873 .. Then, I use command: score- read.csv('file.csv', header = FALSE,sep = ,)

Re: [R] histogram error: 'x' must be numeric

2006-02-10 Thread Barry Rowlingson
jia ding wrote: Then, I use command: score- read.csv('file.csv', header = FALSE,sep = ,) hist(score, main = score) it gives error msg: Error in hist.default(score, main = score) : 'x' must be numeric Can any of you know about it explain me why? Have a look at 'score' in R

Re: [R] Histogram over a Large Data Set (DB): How?

2005-11-18 Thread Eric Eide
Sean == Sean Davis [EMAIL PROTECTED] writes: Sean Have you tried just grabbing the whole column using dbGetQuery? Sean Try doing this: Sean Sean spams - dbGetQuery(con,select unixtime from email limit Sean 100) Sean Sean Then increase

Re: [R] Histogram over a Large Data Set (DB): How?

2005-11-18 Thread Tim Churches
Eric Eide wrote: Sean == Sean Davis [EMAIL PROTECTED] writes: Sean Have you tried just grabbing the whole column using dbGetQuery? Sean Try doing this: Sean Sean spams - dbGetQuery(con,select unixtime from email limit Sean 100) Sean Sean

[R] Histogram over a Large Data Set (DB): How?

2005-11-17 Thread Eric Eide
Hi! I'm new to R, and I have a question about how R works with large data sets --- in particular, data sets that come from databases. I'm using R 2.2.0 with the DBI package (0.1-9) and the RMySQL package (0.5-5). My get-my-feet-wet-with-R project is to make a histogram from a data set stored in

Re: [R] Histogram over a Large Data Set (DB): How?

2005-11-17 Thread Sean Davis
[R] Histogram over a Large Data Set (DB): How? Have you tried just grabbing the whole column using dbGetQuery? Try doing this: spams - dbGetQuery(con,select unixtime from email limit 100) Then increase from 1,000,000 to 1.5 million, to 2 million, etc. until you break something (run out

[R] Histogram font

2005-11-16 Thread Christopher Willmot
The hist() command produces this message on my machine... Error in title(main = main, sub = sub, xlab = xlab, ylab = ylab, ...) : X11 font at size 14 could not be loaded How can I either (a) determine what font is required, or (b) specify one of the fonts I have available? This

Re: [R] Histogram font

2005-11-16 Thread Roger Bivand
On Wed, 16 Nov 2005, Christopher Willmot wrote: The hist() command produces this message on my machine... Error in title(main = main, sub = sub, xlab = xlab, ylab = ylab, ...) : X11 font at size 14 could not be loaded How can I either (a) determine what font is required, or

Re: [R] Histogram font

2005-11-16 Thread Prof Brian Ripley
On Wed, 16 Nov 2005, Christopher Willmot wrote: The hist() command produces this message on my machine... Error in title(main = main, sub = sub, xlab = xlab, ylab = ylab, ...) : X11 font at size 14 could not be loaded How can I either (a) determine what font is required, or (b)

[R] histogram - one bin for all values larger than a certain value

2005-09-26 Thread Florian Defregger
Dear all, I wonder if I can put together a histogram where one bin contains all the values that are larger than a certain specified value. Example: I have values ranging from 0 to 40 and I want 10 bins from 0 to 10, i.e. for the intervals [0,1), [1,2) , ..., [9,10). And then I want one last bin

Re: [R] histogram - one bin for all values larger than a certain value

2005-09-26 Thread Sundar Dorai-Raj
Florian Defregger wrote: Dear all, I wonder if I can put together a histogram where one bin contains all the values that are larger than a certain specified value. Example: I have values ranging from 0 to 40 and I want 10 bins from 0 to 10, i.e. for the intervals [0,1), [1,2) , ...,

Re: [R] histogram - one bin for all values larger than a certain value

2005-09-26 Thread Romain Francois
Le 26.09.2005 16:15, Sundar Dorai-Raj a écrit : Florian Defregger wrote: Dear all, I wonder if I can put together a histogram where one bin contains all the values that are larger than a certain specified value. Example: I have values ranging from 0 to 40 and I want 10 bins from 0 to 10,

Re: [R] histogram - one bin for all values larger than a certain value

2005-09-26 Thread Francisco J. Zagmutt
x=runif(100,0,40) hist(x, breaks=c(0,1,2,3,4,5,6,7,8,9,10,40)) Is this what you had in mind? Francisco From: Florian Defregger [EMAIL PROTECTED] To: r-help@stat.math.ethz.ch Subject: [R] histogram - one bin for all values larger than a certain value Date: Mon, 26 Sep 2005 15:36:21 +0200 Dear

Re: [R] histogram method for S4 class.

2005-08-26 Thread Ernesto Jardim
Deepayan Sarkar wrote: On 8/24/05, ernesto [EMAIL PROTECTED] wrote: Hi, I'm trying to develop an histogram method for a class called FLQuant which is used by the package FLCore (http://flr-project.org). FLQuant is an extension to array. There is an as.data.frame method that coerces flquant

Re: [R] histogram method for S4 class.

2005-08-25 Thread Deepayan Sarkar
On 8/24/05, ernesto [EMAIL PROTECTED] wrote: Hi, I'm trying to develop an histogram method for a class called FLQuant which is used by the package FLCore (http://flr-project.org). FLQuant is an extension to array. There is an as.data.frame method that coerces flquant into a data.frame

[R] Histogram of multiple series on one histogram

2005-06-03 Thread Depire Alexandre
Hello, I have three sample, for example a-c(10,20,10,20,30) b-c(10,20,20,30,30) c-c(20,20,10) I would like to have only one histogram with these series, I try the following code: hist(a) hist(b,add=TRUE,col=red) hist(c,add=TRUE,col=green) but it's

RE: [R] Histogram of multiple series on one histogram

2005-06-03 Thread Jim Brennan
I think you can use barplot for what you want. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Depire Alexandre Sent: June 3, 2005 12:14 PM To: r-help@stat.math.ethz.ch Subject: [R] Histogram of multiple series on one histogram Hello, I have three sample

RE: [R] Histogram of multiple series on one histogram

2005-06-03 Thread Jim Brennan
] [mailto:[EMAIL PROTECTED] On Behalf Of Depire Alexandre Sent: June 3, 2005 12:14 PM To: r-help@stat.math.ethz.ch Subject: [R] Histogram of multiple series on one histogram Hello, I have three sample, for example a-c(10,20,10,20,30) b-c(10,20,20,30,30) c-c(20,20,10) I would

Re: [R] Histogram of multiple series on one histogram

2005-06-03 Thread Romain Francois
Hello alexandre, what you are trying to do is *not* an histogram (as a density estimator), if you divide each bar in 3, the surfaces of a won't sum to 1. However a barplot or a barplot2 (in package gplots, bundle gregmisc) would do the trick. See graph 54 on the graph gallery :

Re: [R] Histogram for mixed random variables

2005-05-06 Thread Stephen D. Weigand
Dear Paul, On May 5, 2005, at 6:43 AM, Paul Smith wrote: Dear All I would like to get the histogram for the following model with discrete and continuous random variables: * with probability 1/3, a random number is drawn from the continuous uniform distribution (min=0, max=1); * with probability

[R] Histogram for mixed random variables

2005-05-05 Thread Paul Smith
Dear All I would like to get the histogram for the following model with discrete and continuous random variables: * with probability 1/3, a random number is drawn from the continuous uniform distribution (min=0, max=1); * with probability 2/3, a random number is drawn from a different continuous

RE: [R] Histogram for mixed random variables

2005-05-05 Thread Liaw, Andy
See http://finzi.psych.upenn.edu/R/Rhelp02a/archive/48428.html Andy From: Paul Smith Dear All I would like to get the histogram for the following model with discrete and continuous random variables: * with probability 1/3, a random number is drawn from the continuous uniform

[R] Histogram

2005-04-20 Thread Mag. Ferri Leberl
Dear everybody! I am analysing data from an enquette. The answers are either A or B. How can I draw a histogram without transforming the data from characters to numbers? If the data are saved in a list M, hist(M[,1]) returns: Error in hist.default(M[, 1]) : `x' must be numeric Execution halted

Re: [R] Histogram

2005-04-20 Thread Achim Zeileis
On Wed, 20 Apr 2005 17:37:04 +0200 Mag. Ferri Leberl wrote: Dear everybody! I am analysing data from an enquette. The answers are either A or B. How can I draw a histogram without transforming the data from characters to numbers? If the data are saved in a list M, hist(M[,1]) returns:

Re: [R] Histogram

2005-04-20 Thread Peter Dalgaard
Mag. Ferri Leberl [EMAIL PROTECTED] writes: Dear everybody! I am analysing data from an enquette. The answers are either A or B. How can I draw a histogram without transforming the data from characters to numbers? If the data are saved in a list M, hist(M[,1]) returns: Error in

RE: [R] Histogram

2005-04-20 Thread Liaw, Andy
From: Mag. Ferri Leberl Dear everybody! I am analysing data from an enquette. The answers are either A or B. How can I draw a histogram without transforming the data from characters to numbers? If the data are saved in a list M, hist(M[,1]) returns: Error in hist.default(M[, 1]) :

RE: [R] Histogram

2005-04-20 Thread Neuro LeSuperHéros
@stat.math.ethz.ch Subject: [R] Histogram Date: Wed, 20 Apr 2005 17:37:04 +0200 Dear everybody! I am analysing data from an enquette. The answers are either A or B. How can I draw a histogram without transforming the data from characters to numbers? If the data are saved in a list M, hist(M[,1

RE: [R] Histogram

2005-04-20 Thread Mulholland, Tom
AM To: '[EMAIL PROTECTED]'; r-help@stat.math.ethz.ch Subject: RE: [R] Histogram From: Mag. Ferri Leberl Dear everybody! I am analysing data from an enquette. The answers are either A or B. How can I draw a histogram without transforming the data from characters to numbers

RE: [R] Histogram

2005-04-20 Thread Mulholland, Tom
, 21 April 2005 10:06 AM To: Mulholland, Tom Subject: RE: [R] Histogram Have you tried it? hist.factor() as defined would be the hist method for the factor class, so hist(f) would work if f is a factor. Andy From: Mulholland, Tom Of course Andy meant hist.factor(f

[R] Histogram over times (without dates)

2005-03-24 Thread Dubravko Dolic
Dear Group, Having a character vector like this one: [1] 03:38:55 07:42:38 08:04:27 08:17:13 08:41:14 08:46:58 [7] 08:47:11 08:53:51 08:57:51 08:58:56 I try to do a histogram over times of a day. All I want to know, if my solution is proper or if there is another way to go.

Re: [R] Histogram over times (without dates)

2005-03-24 Thread Greg Snow
Have you looked at the CircStats and circular? They have some plotting functions that may be of help to you. Greg Snow, Ph.D. Statistical Data Center [EMAIL PROTECTED] (801) 408-8111 Dubravko Dolic [EMAIL PROTECTED] 03/24/05 09:38AM Dear Group, Having a character vector like this one:

Re: [R] Histogram over times (without dates)

2005-03-24 Thread Clint Bowman
I do analyses of that sort all the time with air quality data where I wish to begin to understand daily behavior -- works well in doing model evaluation as well. I'd say your approach should give you useful information; however, I'd think you'd also be interested in a possible day of week

[R] histogram and boxplot in a same postscript

2005-02-16 Thread Cézar Freitas
Hi, all. I need plot a boxplot under a histogram like below, but some configs are troubled: - the boxplot contours the plot, even if I put bty=n, modifying the histogram plot; - I changed the configs of axis to do a 3x3 inches plot, but the result is 2 different axis. For example, the code below

Re: [R] histogram and boxplot in a same postscript

2005-02-16 Thread Uwe Ligges
Cézar Freitas wrote: Hi, all. I need plot a boxplot under a histogram like below, but some configs are troubled: - the boxplot contours the plot, even if I put bty=n, modifying the histogram plot; You want to set axes = FALSE in boxplot() BTW: What is q[4] in your call to points()? Uwe Ligges -

[R] Histogram Bar Spacing or Border Width

2005-02-09 Thread Thomas Hopper
Is there any way to control the spacing between bars in a histogram, or change the border width (I'm assuming the hist() function, though alternatives are welcome)? I'm interested in changing the visual spacing between columns in a plotted histogram. The general effect I'm looking for can be

Re: [R] Histogram Bar Spacing or Border Width

2005-02-09 Thread Prof Brian Ripley
A histogram is a density estimate (at least as defined in the Encyclopedia of Statistics Sciences, if not in many US Universities). It is an area, not a series of unrelated bars, so it makes no sense to have spaces between the subareas. Unfortunately, hist() will also produce barplots of

Re: [R] Histogram Bar Spacing or Border Width

2005-02-09 Thread Zachary Holden
's for each of the unspaced bars. Hope this helps, Zack - Original Message - From: Thomas Hopper [EMAIL PROTECTED] Date: Wednesday, February 9, 2005 7:02 am Subject: [R] Histogram Bar Spacing or Border Width Is there any way to control the spacing between bars in a histogram

Re: [R] Histogram Bar Spacing or Border Width

2005-02-09 Thread Thomas Hopper
I understand the problem from a statistical perspective, and you make an excellent point (as I have come to expect, reading this list). However, I'm thinking about it from a visual/aesthetic perspective. Let me try this. Plot two histograms side-by-side: x - rnorm(10) par(mfcol=c(1,2))

Re: [R] Histogram Bar Spacing or Border Width

2005-02-09 Thread Thomas Hopper
barplot values. If you have groups of bars that you want together, with spaces between the groups, you have to put 0's for each of the unspaced bars. Hope this helps, Zack - Original Message - From: Thomas Hopper [EMAIL PROTECTED] Date: Wednesday, February 9, 2005 7:02 am Subject: [R

Re: [R] Histogram Bar Spacing or Border Width

2005-02-09 Thread Prof Brian Ripley
A hint: hist() does no plotting. That is done by the histogram method of plot(), which you can copy and modify to your own needs/desires. Alternatively you can create myplot() and call myplot(hist(..., plot=TRUE), ...) On Wed, 9 Feb 2005, Thomas Hopper wrote: I understand the problem from a

[R] Histogram

2005-01-04 Thread duraikannan sundaramoorthi
I have data on a single variable LOGT. It has about 300,000 observations. I am trying to make a Histogram out of this data set. Following is my effort. Could anyone help me to solve this error. hist(x) Error in hist.default(x) : `x' must be numeric class(x) [1] data.frame is.object(x) [1]

Re: [R] Histogram

2005-01-04 Thread Andrew Robinson
x is not a numeric vector, so R doesn't know how to take a histogram. Here are your clues: class(x) [1] data.frame is.numeric(x) [1] FALSE so, try names(x) I speculate that LOGT is contained in the dataframe x. If so, try hist(x$LOGT) I hope that this helps. Andrew On Tue, Jan 04,

[R] Histogram with equal-counts (-probability)

2004-12-05 Thread Hamish Macintyre
I would like to use R to generate a histogram which has bars of variable bin width with each bar having an equal number of counts. For example, if the bin limits are the quartiles, each bar would represent 1/4 of the total probability in the distribution. An example of such an equal-probability

[R] Histogram without common borders

2004-07-19 Thread Ross Darnell
Is it possible to produce a histogram directly using the hist() function with the common borders removed? It can be done by plotting the histogram object using type 's'teps. my.hist - hist(x,plot=FALSE) plot(my.hist$breaks,c(0,my.hist$counts),type='s') I would appreciate help Ross Darnell --

Re: [R] Histogram without common borders

2004-07-19 Thread Thomas Petzoldt
Ross Darnell wrote: Is it possible to produce a histogram directly using the hist() function with the common borders removed? It can be done by plotting the histogram object using type 's'teps. my.hist - hist(x,plot=FALSE) plot(my.hist$breaks,c(0,my.hist$counts),type='s') Hello Ross, I think, your

[R] Histogram

2004-05-25 Thread Cristian Pattaro
Dear all, I have a surprising problem with the representation of frequencies in a histogram. Consider, for example, the R code: b-rnorm(2000,3.5,0.3) hist(b,freq=F) When I plotted the histogram, I expected that values in the y-axis (the probability) varied between 0 and 1. Instead, they

Re: [R] Histogram

2004-05-25 Thread Uwe Ligges
Cristian Pattaro wrote: Dear all, I have a surprising problem with the representation of frequencies in a histogram. Consider, for example, the R code: b-rnorm(2000,3.5,0.3) hist(b,freq=F) When I plotted the histogram, I expected that values in the y-axis (the probability) varied between 0 and

Re: [R] Histogram

2004-05-25 Thread Achim Zeileis
On Tue, 25 May 2004 12:27:40 +0200 Cristian Pattaro wrote: Dear all, I have a surprising problem with the representation of frequencies in a histogram. Consider, for example, the R code: b-rnorm(2000,3.5,0.3) hist(b,freq=F) When I plotted the histogram, I expected that values in

RE: [R] Histogram

2004-05-25 Thread Ted Harding
On 25-May-04 Cristian Pattaro wrote: I have a surprising problem with the representation of frequencies in a histogram. Consider, for example, the R code: b-rnorm(2000,3.5,0.3) hist(b,freq=F) When I plotted the histogram, I expected that values in the y-axis (the probability) varied

Re: [R] Histogram ploting

2004-04-19 Thread Martin Maechler
Mateusz == Mateusz £oskot [EMAIL PROTECTED] on Sun, 18 Apr 2004 17:13:34 +0200 writes: Mateusz Hi Christophe, On 4/18/2004 3:17 PM, Christophe Mateusz Pallier wrote: The 'hist' function works on the raw data. In your data set example, you have already computed the number

[R] histogram y-scaling

2004-04-19 Thread Randy Zelick
Hello all, Relative to WinXP R1.8 I have two histograms to plot, and for comparison purposes I want them to have the same Y-scaling. I tried to find the size of the bin with the maximum count before generating the histogram, but this did not work (see below). What is a better way?

Re: [R] histogram y-scaling

2004-04-19 Thread Prof Brian Ripley
?hist reveals argument plot=TRUE, so try plot=FALSE. On Mon, 19 Apr 2004, Randy Zelick wrote: Hello all, Relative to WinXP R1.8 No such thing. There is R 1.8.0 and R 1.8.1 but not R 1.8. I have two histograms to plot, and for comparison purposes I want them to have the same

Re: [R] Histogram ploting

2004-04-18 Thread Christophe Pallier
Hello Mateusz, The 'hist' function works on the raw data. In your data set example, you have already computed the number of data points in each bin. What you really want is probably a barplot of N You could display your data: plot(Class,N,'h') Or names(N)-Class barplot(N) Christophe Pallier

Re: [R] Histogram ploting

2004-04-18 Thread Mateusz oskot
Hi Christophe, On 4/18/2004 3:17 PM, Christophe Pallier wrote: The 'hist' function works on the raw data. In your data set example, you have already computed the number of data points in each bin. Yes, you are right. I evidently misunderstood the hist function usage described in manuals. What

  1   2   >