[R] R help
arun
smartpink111 at yahoo.com
Fri Feb 7 17:19:14 CET 2014
Hi,
YOu could use ?cut().
dat2 <- read.table(text="1 2
Mal 10000
Ram 1000
Ramesh 12344",sep="",header=TRUE,stringsAsFactors=FALSE,check.names=FALSE)
res <- setNames(as.data.frame(table(cut(dat2[,2],breaks=c(0,1000,100000),labels=c("0-1000","1000-100000")))),c("Bins","count"))
res
# Bins count
#1 0-1000 1
#2 1000-100000 2
A.K.
On Friday, February 7, 2014 1:57 AM, Malyadri Putchakayala <malyadri.putchakayala at nuevora.com> wrote:
HI,
How to find binning Ranges in dataset.eg my dataset names like
(1,2,3,4,5,6...).the variable values(variable or numeric I don't know)I know
only dataset name and num of variables. How find binning intervels in above
type of dataset .binning intervels range only find in numeric.
1 2
Mal 10000
Ram 1000
Ramesh 12344
Out put is
Bins count
1 0-1000 1
2 1000-100000 2
I need
More information about the R-help
mailing list