In addition to conversion, you can manipulate the histogram itself to get an idea of ββyour data. This gives you the advantage that the plots themselves remain readable and you get an immediate idea of ββthe distribution in the center. Let's say we model the following data:
Data <- c(rnorm(1000,5,10),sample(-10000:10000,10)) > summary(Data) Min. 1st Qu. Median Mean 3rd Qu. Max. -9669.000 -2.119 5.332 85.430 12.460 9870.000
Then you have several different approaches. The easiest way to see what happens in the center of your data is to simply capture the center of your data. In this case, let's say I'm interested in what happens between the first and third quartiles, I can build:
hist(Data, xlim=c(-30,30), breaks=c(min(Data),seq(-30,30,by=5),max(Data)) main="Center of Data" )

If you also want to count the tails, you can convert your data to collapse the tails and change the axis to reflect this, as follows:
- you assign to all values ββoutside the range of interests a value that is outside this range
- you build a histogram by selecting all extreme values ββin one bunker
- you build the x axis with the correct marks
- you use
axis.break() from the plotrix package to add some breaks on the x axis, pointing to the discontinuous axis
For this you can use something like the following code:
require(plotrix)
This gives you:

Note that you get raw frequencies by adding freq=TRUE to the hist() function.
source share