Skip to content

Cut including the 0 value as separate bin

2 messages · LCOG1, Henrique Dallazuanna

#
Hi everyone,   

I have been using R too long to have to ask this but here i am.  How do i
create a separate bin for the 0 value?  So for:

#Create data frame
DF<-data.frame(A=0:20)
#Create label vector
labs<-1:6
#Create buckets and label
DF$Cut<-cut(DF$A,c(0,4,8,12,14,16,20),labels=labs,include.lowest=TRUE)

I want the 0(zero) value to be in a separate bin.  

Sorry for the lame post...

Thanks guys.

JR