Displaying 1 result from an estimated 1 matches for "binnum".
Did you mean:
bignum
2009 Aug 20
2
Histogram problem
...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 = length(SPXdf[,2])
sig = sd(SPXdf[,2])
BinSize = (3.5*sig)/(Count^(1/3))
BinNum = (Max - Min)/(BinSize)
Bins = seq(Min,Max,by = BinSize)
Count2 = length(Bins)
Num = mat.or.vec(1,Count2)
for (i in 1:Count){
for (j in 1:Count2){
if ((SPXdf[i,2] < Bins[j]))
{Num[j] = Num[j] + 1}
}
}
barplot(Num,Bins, xlab = "SPXdf", ylab = "Frequen...