non overlapping Quantitative class interval or custom class interval

384 Views Asked by At

I am very new to R and I'm looking for a solution on How to create non overlapping class internal.

I did tried searching the stack overflow but unfortunately didn't find any answers.

Here is what i want and what i did:

x <- c(1,2,3,4,5,6,7,8,9)

i want - "1-3, 4-6 and 7-9" but what i am getting is - "1-3, 3-5, 5-7 and so on"

I used the below:

check <- c(1,2,3,4,5,6,7,8,9)
Check1 <- classIntervals(check, n=3, style='jenks')

Please note that i don't want to use the lengthy nested if conditions which is very in-efficient.

any help would be greatly appreciated.

Regards, Sagar Gupta

0

There are 0 best solutions below