Displaying 20 results from an estimated 60000 matches similar to: "questions for hist()"
2007 Jun 22
1
Switching X-axis and Y-axis for histogram
Dear all,
I'm creating a histogram with the function hist(). But
right now what I get is column representation (as normal).
I'm wondering if I could switch X-axis and Y-axis and
get row-representation of frequencies?
One more question, can I define the step of each axises
for the histogram?
Thanks so much!
Donghui
2000 Nov 17
2
hist() and density
There were some questions about hist() a couple of days ago which
triggered this post. My question/suggestion is about the y-axis in hist.
There are reasons to prefer making the y-axis density=relative
frequency/bin width. One reason is that the height of the plot does not
depend on the bin width; another is that if your histogram is in density
then you can easily superimpose a smooth theoretical
2004 Nov 26
2
hist and truehist
Hello!
Up to now I have been using hist() to display the distributions.
Howevere, I noteiced strange numbers on y (vertical) axis, if I used
probability = T or freq = F option. I thought it is a bug and launched
the R-bug system and found some posts on that matter. Brian Ripley
responded to one, that one should look at truehist() for that. Ok I can
use truehist() if I want to see the ratios
2005 Jun 17
1
hist.default documentation
I think there are a couple of things in ?hist that are not quite as
clear as they could be.
(1)
freq: logical; if 'TRUE', the histogram graphic is a representation
of frequencies, the 'counts' component of the result; if
'FALSE', _relative_ frequencies ("probabilities"), component
'density', are plotted. Defaults to
2004 Aug 21
1
relative frequencies for hist()
I have problems getting a histogram with relative frequencies on the y-axis.
Here is an example data set:
> a <- c(4.626, 4.627, 4.627, 4.628, 4.629, 4.629, 4.630, 4.631, 4.632,
4.632)
> d = hist(a,freq=F)
> d$density
[1] 299.9999 100.0000 200.0000 100.0000 100.0000 200.0000
The obtained densities are given by counts/(total n * bin width), with
bin width being
1997 Dec 23
0
R-beta: bug in hist() (0.60/0.61)
I discovered a bug in hist().
Try the following:
x<-c(-5,-4,-4,-4,-3,-3,-3,-3,-2,-2,0,0,0,0,1,1,1,3,3,5,6)
# Note that sum(x)<0:
sum(x)
# [1] -13
hist(x)
# looks ok
hist(x,freq=F)
# negative bars !!
# and finally this gives not 1:
sum(hist(x,plot=F)$rel.freqs)
# [1] -0.8076923
The reason is, that "sum(x)" is used instead of "length(x)" in the following
line near
2006 Apr 05
1
hist function: freq=FALSE for standardised histograms
Dear All,
I am a undergraduate using R for the first time. It seems like an excellent
program and one that I look forward to using a lot over the next few years,
but I have hit a very basic problem that I can't solve.
I want to produce a standardised histogram, i.e. one where the area under
the graph is equal to 1. I look at the manual for the histogram function and
find this:
freq:
2006 Aug 16
0
Strange behavior with "hist" function filled with breaks and freq attribute
Hy all,
I give example code :
connexions_jours<-c(1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,6,6,7,7,7,7,7,7,7,7,8,8,8,12,15,19)
pas_de_groupe<-1
hist(connexions_jours,col="red",xlab="RĂ©partition du nombre de connexions par jours (sans
2019 Oct 01
1
Improvement in hist command documentation
Hi all,
In the histogram created with the `hist` command, the label of the y axis reads "Frequency ?.
Finding that the ylab key is used to change (localize) that word may seem difficult for people
who are beginners either in R or in english.
I suggest very minor modifications of the file hist.Rd at https://svn.r-project.org/R/trunk/src/library/graphics/man/hist.Rd.
1) make the default value
2002 Oct 03
0
[Fwd: curiousity with hist]
just realized that the bin value is actually the relative frequency
divided by the bin width. sorry for consuming band width.
Alas, is there anyway to make hist() calculate relative frequencies
irrespective of bin width?
thanks
Murad Nayal wrote:
>
> Hello,
>
> I am rather new to R. in trying to use the hist() command I get behavior
> that is somewhat puzzling me, in short,
2012 Jun 15
1
some help to improve "hist to plot relative frequencies"
Dear Researches,
sorry for disturb. I wish to improve my figure in R plotting the relative
frequencies of my data set.
library(lattice)
a <- c(0,0,0,1,1,2,4,5,6,7,7,7,7,7,8,8,8,8,9,9,9,9,10,10,11)
histogram(a, xlab="myData")
what i wish to do is:
1) invert the order of X and Y (eg: Precent of Total on X-axis and "MyData"
on X-axis)
2) plot not the bar of histogram but a
2009 Jun 04
3
Understanding R Hist() Results...
Think I'm missing something to understand what is going on with hist(...)
http://n2.nabble.com/What-is-going-on-with-Histogram-Plots-td3022645.html
For my example I count 7 unique years, however, on the histogram there only 6. It looks like the bin to the left of the tic mark on the x-axis represents the number of entries for that year, i.e. Frequency.
I guess it looks like the bin for
2010 Nov 08
3
how do i plot this "hist"?
Hi all,
I have the following data in abc.dat
=======================
50 0 1 0 0
55 1 14 0 1
60 7 86 0 3
65 22 324 2 3
70 58 1035 1 7
75 30 2568 0 34
80 9 2936 15 162
85 27 2169 46 365
90 80 1439 212 432
95 236 1670 521 281
100 332 827 709 172
105 156 311 556
2013 Jan 22
3
density of hist(freq = FALSE) inversely affected by data magnitude
Hi,
I have a couple of observations, a question or two, and perhaps a
suggestion related to the plotting of density on the y-axis within the
hist() function when freq=FALSE. I was using the function and trying
to develop an intuitive understanding of what the density is telling
me. After reading through this fairly helpful post:
2004 May 25
5
Histogram
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 varied within the
range 0-1.3.
Have you got any suggestion for obtaining a correct graph with
2003 Sep 18
2
hist will not use parameter xaxs (PR#4219)
Full_Name: Mark Wall
Version: 1.6.0
OS: linux
Submission from: (NULL) (63.251.119.254)
I want to plot a histogram of a *subset* of some data:
>t = c(0:9)
>hist(t,right=FALSE,breaks=10,xlim=c(0,5),xaxs="i")
This means I should plot a histogram from 0 to 5 with breaks at 1,2,3,4. This
should produce exactly 5 bars of frequency=1. Instead I get 5 and 1/4 bars. I
do not want the
2006 Aug 25
1
How to get back POSIXct format after calculating with hist() results
Hi,
I have a casting/formatting question on hist.POSIXt:
The histogram plot from POSIXct works perfect (with help of Prof. Ripley
-thanks!).
When processing the hist(plot=FALSE) output and then plotting the
results over the x-axis (bins) coming from hist(), I lose the date/time
labels, getting instead integers displayed.
Trying to cast the $breaks with as.POSIXct gives silly results with
2011 Jun 09
1
histogram - density on y axis and restriction to interval [0, 1]
Hello,
To indicate probability densities instead of counts on a histogram, I
specify freq = FALSE.
However, I expect that summing all top y coordinates over all the
intervals of the histogram will provide 1.
1)
v <- c(0.2885, 0.2988, 0.3139, 0.2615, 0.3179, 0.3163, 0.2583, 0.3052,
0.2527, 0.3147, 0.3235, 0.2408, 0.2480, 0.3108, 0.3577, 0.2829, 0.2694,
0.3275, 0.3314, 0.2639, 0.3076,
2010 Jan 03
3
Thin bars in R hist !!??
Hi,
I am trying to plot a histogram with my dataset that has 68 elements, 67 of
which are zero and the last one is 18. It can be reproduced as follows:
x<-array(0, dim=(68))
x[1] = 18
I am trying to plot its histogram using:
hist(x, breaks=10, xlim=c(0, 100), axes=F)
axis(2, at=seq(0, 70, 5)) # for the y-axis
axis(1, at=seq(0, 100, 10)) # for the x-axis
As you would also see if you
2011 Apr 29
4
plot several histograms with same y-axes scaling using hist()
Dear all
Problem: hist()-function, scale = ?percent?
I want to generate histograms for changing underlying data. In order to make
them comparable, I want to fix the y-axis (vertical-axis) to, e.g., 0%, 10%,
20%, 30% as well as to fix the spaces, too. So the y-axis in each histogram
should be identical. Currently, I have 100 histograms and the y-axis scales
changes in each.
Here is my code: