similar to: problem with "breaks" in histogram (PR#710)

Displaying 20 results from an estimated 8000 matches similar to: "problem with "breaks" in histogram (PR#710)"

2008 Aug 27
1
Odd behavior in histogram breaks?
I am looking at histogram breaks, and notice something odd: > foo <- hist(runif(10000),breaks=20) > length(foo$breaks) [1] 21 This makes sense to me. > foo <- hist(runif(10000),breaks=200) > length(foo$breaks) [1] 201 This also makes sense. BUT > foo <- hist(runif(10000),breaks=250) > length(foo$breaks) [1] 201 > foo <- hist(runif(100000),breaks=250) >
2009 Feb 16
1
Adjusting the Axis in a histogram to the prespecified breaks
Hello I tried a few searches on hist, histogram, equidist and space (space=0 was mentioned in one contribution), but none of that so far worked. It also says in the help "##-- For non-equidistant breaks, counts should NOT be graphed unscaled:" - which is precisely what I am looking for, but I cannot find it. I want to make a histogram using breaks which are spaced exponentially and in
2010 Jan 28
1
Setting breaks for histogram of dates
Hi, I have a list of dates like this: date 2009-12-03 2009-12-11 2009-10-07 2010-01-25 2010-01-05 2009-09-09 2010-01-19 2010-01-25 2009-02-05 2010-01-25 2010-01-27 2010-01-27 ... and am creating a histogram like this t <- read.table("test.dat",header=TRUE) hist(as.Date(t$date), "years", format = "%d/%m/%y", freq=TRUE)
2010 Apr 16
1
histogram breaks
=============================== Q2=c( + sample(10:19,8,T), + sample(20:24,15,T), + sample(25:29,25,T), + sample(30:39,18,T), + sample(40:49,12,T), + sample(50:64,7,T), + sample(65:89,5,T) + ) ================================ hist(Q2) can give me a histogram, however, how do i get a different 'breaks'? i want to be break down into the intervals as my 'sample'? i.e. the 1st
2010 Apr 27
2
Histogram not plotting correct breaks
Hi, I'm using the hist function to plot the frequency of 21 variables, but it keeps starting the x-axis from 0 and adding variables 1 and 2 together (all other vairables have the correct frequencies). I suspect it adds 1 and 2 together so that 0 can fit in with demarcations at intervals of 5. Using "xlim=c(1,21)" to specify that i don't want to include 0 and using the
2004 Jul 20
1
Histogram without common borders
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 -- University of Queensland, Brisbane QLD 4067 AUSTRALIA Email: <r.darnell at
2003 Jul 03
4
Generating a vector for breaks in a histogram
Hi I have two lots of numbers which I would like to histogram using the hist() function. For comparative reasons, I want them to be on the same scale, which I can use the xlim and ylim options to achieve. However, having them on the same scale is meaningless unless they have the same "breaks". Consulting the documentation, there are 4 ways of defining the number of breaks, only one
2001 Jan 12
1
Histogram for factors
Hi, I keep running into this: R> hist (f) Error in hist.default(f) : `x' must be numeric To which of course something like (simplified but not beyond repair): R> hist.factor <- function (ff) { jj <- table (ff) jb <- barplot (jj, ylab="Frequency", xlab=deparse(substitute(ff))) axis (1, jb, names (jj)) } R> hist (f) is a possible solution. Why is a
2011 Jul 24
1
Histogram of a dataframe subset failing
Like most help forum users, I'm very new to R. I've been having this problem: I started with a dataframe called fullData. With the subset command, I split it into two separate dataframes, soloData and teamData. The hist() function works when I use... hist( subset(fullData, fullData$playlist_id==4 )$deaths) ...the exact call to subset() that I used to create each dataframe. However,
2011 Apr 22
1
histogram of dates
I can't seem to get a histogram of dates: tmt910% R --vanilla R version 2.13.0 (2011-04-13) Copyright (C) 2011 The R Foundation for Statistical Computing ISBN 3-900051-07-0 ... > temp <- as.Date(1:200, origin="1970/01/01") > range(temp) [1] "1970-01-02" "1970-07-20" > hist(temp) Error in .Internal(inherits(x, what, which)) : 'x' is missing
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:
2005 Jun 13
3
Lattice: Combining xyplot and histogram
Dear all, I am trying to create a lattice plot which consists of 1 xyplot and 2 histograms (each for x and y). My first try was like this: x<-rnorm(1000) y<-rnorm(1000) xy <- xyplot(y~x) hist.x <- histogram(x) hist.y <- histogram(y) print(xy, position=c(0, 0.2, 1, 1), more=TRUE) print(hist.x, position=c(0, 0, 1, 0.33),more=T) print(hist.y, position=c(0.8, 0, 1, 1)) Ok, this is
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.
2001 Mar 05
1
histogram of frequencies (PR#861)
Full_Name: Dr. Bernd Winkler Version: 1.2.2 OS: Linux Submission from: (NULL) (194.59.179.176) Hi all, having updated to version 1.2.2 last week I experienced some strange behaviour of the hist function. I want to plot a histogram of frequencies resp. counts, for example poisson random numbers, on a predefined and fixed x scale > hist(rpois(500, 2), breaks=0:10) But instead of the
2006 Aug 23
1
how to get a histogram of an POSIXct vector ?
Hi, search on web indicates that R also includes a hist method on POSIXct vectors. My (perhaps too unexperienced) approach below yields an error. Could somebody give me a hint what's wrong ? Peter > str(samples) `data.frame': 7500 obs. of 1 variable: $ DateTime:'POSIXct', format: chr "2006-07-20 00:10:08" "2006-07-20 00:11:17" "2006-07-20
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,
2011 May 24
1
histogram with density
Hello All,* *I want to draw a histogram with density curve. * *For that simply i created a data called*"x" *and i used the function called * hist(x, col = "blue", freq = FALSE),** *from this function i got a histogram*. *After that , i tried this function* ** lines(density(x), col = "red", lwd = 2 ) *but i could not get the density curve. So, Again i used
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 Oct 16
2
histogram labels
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 'losses' (below) to be on the bar's. Thanks, Paul
2011 Mar 07
1
help needed with histogram plotting
Dear all, I am trying to plot 3 histograms on the same graph using the following command. hist(x,xlim=c(0,100)) hist(y,add=TRUE) hist(z,add=TRUE) The xlim of y is c(20,21) and that of z is c(99,99.5) , whereas the variable x has xlim at c(0.5,2). Apparently, the graph end of displaying a line only, corresponding to each histogram due to the wide range of the xlim and tightness of the