Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>When you call plot on an object of class histogram (like c1), it calls the S3 method for the histogram. Namely, <code>plot.histogram</code>. You can see the code for this function if you type <code>graphics:::plot.histogram</code> and you can see its help under <code>?plot.histogram</code>. The help file for that function states:</p> <blockquote> <p>freq logical; if TRUE, the histogram graphic is to present a representation of frequencies, i.e, <code>x$counts</code>; if FALSE, relative frequencies (probabilities), i.e., x$density, are plotted. The default is true for equidistant breaks and false otherwise.</p> </blockquote> <p>So, when plot renders a histogram it doesn't use the previously specified <code>probability</code> or <code>freq</code> arguments, it tries to figure it out for itself. The reason for this is obvious if you dig around inside <code>c1</code>, it contains all of the data necessarily for the plot, but does not specify how it should be rendered.</p> <p>So, the solution is to reiterate the argument <code>freq=FALSE</code> when you run the plot functions. Notably, <code>freq=FALSE</code> works whereas <code>probability=TRUE</code> does not because <code>plot.histogram</code> does not have a probability option. So, your plot code will be:</p> <pre><code>plot(c1, col=rgb(1,0,0,1/4), xlim=c(minx,maxx), main=paste(paramlab,"Group",groupnum,sep=" "),xlab="",freq=FALSE)# first histogram plot(c2, col=rgb(0,0,1,1/4), xlim=c(minx,maxx), add=T, freq=FALSE) </code></pre> <p>This all seems like a oversight/idiosyncratic decision (or lack thereof) on the part of the R devs. To their credit it is appropriately documented and is not "unexpected behavior" (although I certainly didn't expect it). I wonder where such oddness should be reported, if it should be reported at all.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload