0

I have a large dataset with response times. I need to make reference to the first empty bin of the histogram (with x being milliseconds), and exclude all data that comes after that.

I think

Can anybody help?

RobertP.
  • 213
  • 1
  • 12
  • Could you share your data? See also [here](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example). That makes it a lot easier to help. – Florian Jan 27 '18 at 17:55

1 Answers1

1

If you capture the return of hist it contains all of the information that you need.

set.seed(3)
x = rnorm(20)
H = hist(x)

min(which(H$counts == 0))
[1] 5

To exclude the data that bin and above

MIN = min(which(H$counts == 0))
x = x[x<H$breaks[MIN]]
G5W
  • 36,531
  • 10
  • 47
  • 80