How can I construct a histogram of a integer value variable with bins of varying size in R?
09:33 19 Jan 2026

This is R code.

I have two variables in a data frame. A population identifier variable P and a variable F that identifies in which firm the person works. I have sorted the data frame so that it is ordered by firm and i know how many persons work in each firm, Z.

How can I construct a histogram of the integer value variable Z where bins are given by (<1, 1, 2, 3, 4,5 to10,11 to 50)?

r histogram bins