1

I'm trying to plot some data on a histogram using R so I can make a Chi Squared Test on it later. I was told to use some specific breaks on the histogram, but when I use it, I get the error on the title. Here's the code:

aux = hist(x, freq=F, col='lightblue', breaks=c(50, 150, 200, 1500))
hist(x, nclass=15, freq=F, col='lightblue')

The length of the dataset is 59 and the maximum value is 1286.137. I've already done this before without problem, with another dataset en different breaks, so I don't know what could be causing the error. Any ideas?

Felipe Q.
  • 33
  • 1
  • 5
  • 2
    Including a [minimal reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) in your question will increase your chances of getting an answer. – Samuel Nov 12 '17 at 00:37
  • if there are only 59 entries then editing your question to include the output from `dput(x)` – drJones Nov 12 '17 at 03:42

1 Answers1

0

I think that your minimum value is less than 50. Try:

aux = hist(x, freq=F, col='lightblue', breaks=c(min(x), 150, 200, 1500))
drJones
  • 1,233
  • 1
  • 16
  • 24