similar to: breaks/bins question

Displaying 20 results from an estimated 10000 matches similar to: "breaks/bins question"

2006 Nov 14
2
dividing vectors into bins with equal widths
Hi R-users, I am trying to divide a vector (say X) into equal frequency bins. If one uses the hist() function, then a histogram is plotted, but with bins of equal widths, and not with bins having the same number of data points. I have then tried the histogram() function as follows: histogram(X, nint=10, breaks=NULL, equal.widths=F) This works as I want. However, I can't extract which
2013 Feb 08
2
Count of Histogram Bins using Shingles with lattice
I know that I can get a count of histogram bins in base R with plot=FALSE. However, I'd like to do the same thing with lattice. The problem is that I've set up shingles, and I'd like to get the count within each bin within each shingle. plot=FALSE doesn't seem to do it. [[alternative HTML version deleted]]
2006 May 01
4
table of means/medians across bins used for a histogram
Hi I am trying to get a table of means of parameter 1 across BINS of parameter 2. I am working in proteomics and a sample of my data is as follows cluster-age clock-rate(evolutionary rate) scopclass 0.002 10 A 0.045 0.1 B 0.13 15 A 0.15 34 D .... .... ....
2011 Aug 21
1
Histogram from frequency data in pre-made bins
Dear R user, I am using UK census data on travel to work. The authorities have provided a breakdown in each area by mode (car, bicycle etc.) and distance travelled (0 ? 2 km, 2 ? 5 km etc). Therefore, after processing, the data for Sheffield look like this https://files.one.ubuntu.com/ej2VtVbJTEaelvMRlsocRg : dshef <- read.table("distmodesheff.csv", sep=",", header=TRUE)
2001 May 07
1
unexpected breaks in hist
Hello R-list, I've been using hist to plot histograms of some data, but I get variable numbers of bins. I understood from reading the help file that breaks will set the number of bins. Please correct me if I'm wrong. I'm plotting measures from subsets of a larger data set. Depending on the data subset the number of bins varies despite having set breaks to 5 in all cases. See
2006 Feb 17
1
How to change the number of bins in "hist" function?
Hi all, I am doing histogram using the "hist" function. For some reason, the histogram does not look good... is there a way I can change the number of bins, and/or change the way that data gets binned... so that I can obtain a better looking histogram? Thanks a lot! [[alternative HTML version deleted]]
2007 Apr 19
1
Histogram with uneven bins
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 (almost always, actually) extend beyond the axis labels (i.e., there are unlabeled bars). I would
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.
2008 May 20
2
hist clarification
Can someone help me with a misunderstanding I'm having with hist? I expected, from the example below, that the number of bins would always be 10 and the length of the counts array the same. According to the help section 'breaks' can be a integer indicating the number of bins. From the example below, the number of bins (length of the counts array) varies. Am I wrong in expecting the
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
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
2007 Oct 24
2
Graphics - plotting two graphs
Hi, I wanted to plot 2 lines on a single graph. Each graph has one axis that can be common. The code that I'm using is: ------------------------------------------------------- par(mfrow=c(1, 1)) x1 <- c(2, 4, 6, 8, 10, 12) x2 <- c(10, 20, 30, 40, 50, 60) y1 <- c(10,12,15,22,34,21) y2 <- c(40, 130, 150, 145, 40, 30) par(las=1, mar=c(4, 4, 2, 4)) plot.new()
2011 Dec 07
1
Rank samples by breaks in hist and assign result as factor
Hi R users, My goal is to rank my samples according to how they fall out in a histogram with 10 bins to produce a ranking for each sample according to where it falls on the histogram, with a "1" to represent one tail of the hist, a "10" to represent the other tail, and a "5" for the median/mean. I have a number of different data sets to do this with and in all cases
2009 Dec 08
1
histbackback function
Hi, I'm trying to recreate a sensitivity-specificity graph using the histbackback function. The only problem is that these graphs are typically drawn with vertical rather than horizontal bar plots (and the histbackback function only seems to work with horiz=TRUE argument, using "horiz=FALSE" doesn't work). Does anyone know if: 1) there's a different graphing function that
2008 Oct 20
4
aggregating along bins and bin-quantiles
Dear all, I would like to aggregate a data frame (consisting of 2 columns - one for the bins, say factors, and one for the values) along bins and quantiles within the bins. I have tried aggregate(data.frame$values, list(bin = data.frame $bin,Quantile=cut2(data.frame$bin,g=10)),sum) but then the quantiles apply to the population as a whole and not the individual bins. Upon this
2010 Sep 22
3
Extracting bins and frequencies from frequency table
Dear R users, I would like to great a frequency table from raw data and then access the classes/bins and their respective frequencies separately. Here the code to create the frequency tables: x1 <- c(1,5,1,1,2,2,3,4,5,3,2,3,6,4,3,8) t1 <- table(x1) print(t1[1]) Its easy to plot this, but how do I actually access the frequencies alone and the bins alone? Basically I am looking to get:
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
2011 Aug 31
1
unequal bins in filled.contour
Hello, I am trying to plot SADIE red-blue plots of cluster indicies using filled.contour. I want a plot which only has three bins for the data: <-1.5, -1.5 - 1.5, >1.5, but I am having trouble getting there. example X1 X2 X3 X4 X5 1 -5 -4.5 1.0 4.5 6 2 -3 -2.0 1.2 -1.0 3 3 0 0.0 0.0 -0.5 -1 4 -2 -3.0 1.0 1.5 3 5 -6 -2.0 0.5 3.0 2 example<-as.matrix(example)
2017 Apr 13
2
Variograma - Bins
Hola, cordial saludo, estoy trabajando con geoestadística y tengo la siguiente inquietud ¿Existe algún criterio óptimo para determinar el número de bins en un semivariograma? sé que el paquete geoR tiende a tomar por defecto 13 bins y gstat 15 ¿pero existe algún criterio detrás de dicha elección? Gracias de antemano a quien pueda resolver mi duda. -- *Carlos A. Taimal Yepes* *Estudiante de
2012 Mar 16
1
Identifying a change in events between bins
Hi there, First off, despite this being my first post here, I have scanned the R help forums a lot in the past few months to help with some questions, so a big thank you to the community as a whole for being so helpful! I'm somewhat of an R newbie, and have run up against a problem that I can't seem to solve. If anyone is able to help I would really appreciate it! I'm looking at a