Displaying 20 results from an estimated 9000 matches similar to: "how to make a histogram with non-numeric x's?"
2009 Apr 22
1
converting histogram to barchart
Hi list,
After a lot of tweaking i have managed to create a histogram with an
overlaying density plot. The histogram shows a sample of birth weights
of babies and the density plot shows birth weights from a much larger
reference populaton. My data is divided in 0.1 Kg bins so in the code
below binweigh=0.1.
The trouble with the current graph is that it is not very clear since
the density plot
2012 Jul 05
3
Histogram
I have a column of 1000 datapoints from the normal distribution with mean 2
and variance 4. How can I get a histogram of these observations with 20
bins with each bin having 50 observations?
--
Thanks,
Jim.
[[alternative HTML version deleted]]
2009 Aug 20
2
Histogram problem
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 = max(SPXdf[,2])
Min = min(SPXdf[,2])
Count =
2011 Jul 15
3
Drawing a histogram from a massive dataset
Dear All,
I have a massive dataset from which I would like to draw a histogram.
Any ideas on how to accomplish this?
Thanks in advance,
Paul
2012 Jul 10
2
Changing x-axis values displayed on histogram
Is it possible to change the x-axis values in a histogram to reflect binned
values?
Here are my data:
histexample<-c(6,7,7,8,8,8,9,9,9,9,9,10,10,10,10,10,10,10,11,11,11,11,11,11,12,12,12,12,13,13,13,14,14,14,15,16)
hist(histexample)
Now, I'll bin pairs of adjacent values together (e.g., 5-6, 7-8, 9-10,
11-12, 13-14, 15-16) using the following
bins<-c(4.5,6.5,8.5,10.5,12.5,14.5,16.5)
2009 Jul 03
3
Histogram
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
--
View this message in context: http://www.nabble.com/Histogram-tp24325261p24325261.html
Sent from the R
2009 May 09
2
Histogram frequencies with a normal pdf curve overlay
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 same normal pdf overlay, so that the plot would still look
the same?
Regards,
2006 Jun 08
3
Re-binning histogram data
Hi,
Short Version:
Is there a function to re-bin a histogram to new, broader bins?
Long version: I'm trying to create a histogram, however my input-data is
itself in the form of a fine-grained histogram, i.e. numbers of counts
in regular one-second bins. I want to produce a histogram of, say,
10-minute bins (though possibly irregular bins also).
I suppose I could re-create a data set as
2008 May 15
1
lattice histogram problem with integers values and nint
been puzzling over this for a day.
Summary
integer variable to use with histogram, 170,000 rows. Value is day of
year. Hist works, lattice histogram with nint does not work (spurious
spikes in display), lattice histogram using breaks=c(0:365) works
fine. Spike values appear to be sum of two adjacent bins. Want to
know if this is a familiar problem, and what the recommended
work-around is.
2011 Jan 13
3
Question about histogram
Dear list,
I'm new to R, please bear with my silly questions. I'm trying to get an
understanding of why the results I get from a call to hist() are not as
I thought I would get. When I use the parameter freq=FALSE, I think the
plot will contain bars that none of them is larger than 1, because
they're probabilities. But for my code, the bars exceeded 1.
The actual data seems
2012 Dec 06
2
Best way to coerce numerical data to a predetermined histogram bin?
Folks:
Say I have a set of histogram breaks:
breaks=c(1:10,15)
# With bin ids:
bin_ids=1:(length(breaks)-1)
# and some data (note that some of it falls outside the breaks:
data=runif(min=1,max=20,n=100)
***
What is the MOST EFFICIENT way to "classify" data into the histogram bins
(return the bin_ids) and, say, return NA if the value falls outside of the
bins.
By classify, I mean
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,
2005 Mar 10
1
Transparent colors OR two series on one histogram
Hi,
I want to be able to plot a single histogram of a measured trait with
trait values from two conditions on the same histogram to allow easy
comparison.
I have previously done this in excel by plotting the two series on a
single bargraph having calculated frequencies in bins. You then get one
condition plotted immediately to the right of the other. I hope that
makes sense?
I don't
2009 Apr 17
3
Create histogram from data matrix
Hello!
Thanks for reading this request for assistance. I have a question
regarding creating a histogram-like figure from data that are not
currently in the correct format for the "hist" command.
Specifically, my data have been processed and are in a matrix with
columns containing the variables of interest and separate columns
containing the number of times this variable was
2010 Jun 28
2
Stacked Histogram, multiple lines for dates of news stories?
Dear colleagues,
I have extracted the dates of several news stories from a newspaper
data base to chart coverage trends of an issue over time. They are in
a data frame that looks just like one generated by the reproducible
code below.
I can already generate a histogram of the dates with various intervals
(months, quarters, weeks years) using hist.Date. However, there are
two other
2006 Nov 07
1
histogram bin width
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 must be a manual way to do this which is fine with me. i
tried breaks=0.05 but it wasn't happy
2007 Sep 17
3
Histogram with colors
Is there a simple way to plot a histogram with colors?
For example, suppose I generate random points in the
N(2,1) distribution:
x <- rnorm(100000, mean = 2, sd = 1)
Now I would like to plot the histogram:
hist(x)
but I would like to show the bars with x < 0 in red, and the
bars with x >= 0 in lightgreen. Is there any simple way to
do it?
I think I can do it in two steps:
2012 Mar 12
3
A question on histogram - area much less than 1
Hello,
I have problem running the histogram function "hist". The area under the
histogram is much lower than 1. Could anyone tell me what the problem is?
Thanks,
(The total number of observation is 992 (close to 1000), so the
probability that 0<Y1<35 is approximately 0.277)
miao
rm(list=ls())
par(mfrow=c(1, 1))
Y <- cbind(matrix(35*0.5,1,277), matrix(35*1.5, 1, 146),
2006 Feb 10
1
histogram error: 'x' must be numeric
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 = ",")
hist(score, main = "score")
it gives error msg:
Error in
2011 Mar 29
3
producing histogram-like plot
Hi!
I have a dataset that looks like this:
0.0 14
0.0 3
0.9 12
0.73 15
0.78 2
1.0 15
0.3 2
0.32 8
...and so on.
I.e. a value between 0 and 1, and a number
I would like to plot this in a histogram-like manner. I would like to
have a set of bins, each 0.1 wide, and plot the sum of values in column
2 that falls within each bin. I.e, in this case I would like the first
bin, 0.0, to have the