search for: nbreaks

Displaying 8 results from an estimated 8 matches for "nbreaks".

Did you mean: breaks
2003 Apr 02
1
normalized frequency histogram
...divide the series by this interval length, and then plot the relative frequency. The problem is determining the interval length that will be used in advance. I'm supposed to manually pick the # of intervals between 20 and 40 (not use sturges). However, when I try different values for the nbreaks parameters, incrementing from 20 - 40, the histogram only changes at a couple of points on that interval. Anyone have any suggestions as to how I should create this plot? Or an explanation as to why my nbreaks parameter does not seem to force the number of intervals, but rather suggests a ball...
2010 Nov 19
1
Color Alaska in USA map
...the second column of data): alaska, 1, 2 Hawaii, 0, 0 USA, 5, 5 And here is my code: library("latticeExtra") library("mapproj") state<-read.table("C:\\usaclass.txt",sep=",") state range<-with(state,range(state[1:3,3])) range nbreaks=6 breaks<-do.breaks(range,nbreaks) StateName<-state[1:3,1] StateName mapplot(StateName~state[1:3,3],data=state,breaks=breaks, map=map("world", c("USA", "Hawaii"), fill=TRUE) ,scales=list(draw=FALSE), colramp = colorRampPalette(c("white", "black&quo...
2008 Jul 29
3
table questions
Hi again! Suppose I have the following: > xy <- round(rexp(20),1) > xy [1] 0.1 3.4 1.6 0.4 1.0 1.4 0.2 0.3 1.6 0.2 0.0 0.1 0.1 1.0 2.0 0.9 2.5 0.1 1.5 0.4 > table(xy) xy 0 0.1 0.2 0.3 0.4 0.9 1 1.4 1.5 1.6 2 2.5 3.4 1 4 2 1 2 1 2 1 1 2 1 1 1 > Is there a way to set things up to have 0 - 0.4 0.5 - 0.9 etc. please? I know there is the cut
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
2010 Jul 15
0
Histogram with two groups on the same graph (not on separate panels)
...ad.csv(file = "D:\\data 12.24.06\\AllMamushiCorrected5.8.10_7.12.10.csv", header=TRUE, strip.white=TRUE, na.strings="") attach(gb)   superhist2pdf <- function(x, filename = "super_histograms.pdf", dev = "pdf", title = "Superimposed Histograms", nbreaks ="Sturges") { junk = NULL grouping = NULL for(i in 1:length(x)) { junk = c(junk,x[[i]]) grouping <- c(grouping, rep(i,length(x[[i]]))) } grouping <- factor(grouping) n.gr <- length(table(grouping)) xr <- range(junk) histL <- tapply(junk, grouping, hist, breaks=nbreaks, plot...
2011 Jun 21
2
setting breaks in hist
Dear R People: Is there a way to "guarantee" that breaks=n will give you exactly n breaks, please? I'm fairly certain that the answer is "no", but thought I'd check. Thanks, Erin -- Erin Hodgess Associate Professor Department of Computer and Mathematical Sciences University of Houston - Downtown mailto: erinm.hodgess at gmail.com
2010 Oct 15
2
feed cut() output into goodness-of-fit tests
Hello, My question is assuming I have cut()'ed my sample and look at the table() of it, how can I compute probabilities for the bins? Do I have to parse table's names() to fetch bin endpoints to pass them to p[distr-name] functions? i really don't want to input arguments to PDF functions by hand (nor copy-and-paste way). > x.fr <- table(cut(x,10)) > x.fr (0.0617,0.549]
2006 Feb 21
6
How to sum values across multiple variables using a wildcard?
I have a dataframe called "data" with 5 records (in rows) each of which has been scored on each of many variables (in columns). Five of the variables are named var1, var2, var3, var4, var5 using headers. The other variables are named using other conventions. I can create a new variable called var6 with the value 15 for each record with this code: > var6=var1+var2+var3+var4+var5