From tomhopper at comcast.net  Thu Feb 10 17:30:11 2005
From: tomhopper at comcast.net (tomhopper@comcast.net)
Date: Thu Feb 10 17:30:19 2005
Subject: [Rd] hist() error when prob=NULL (PR#7682)
Message-ID: <20050210163011.D3450DEEB@slim.kubism.ku.dk>

Full_Name: Tom Hopper
Version: 2.0.1
OS: Windows 2000
Submission from: (NULL) (69.220.229.2)


While attempting to wrap hist() in my own custom function (for formatting
purposes), I notice that a call like

   > hist(x, prob=NULL)

produces the output:

   Error in if (freq) x$counts else { : argument is of length zero

Switching to use freq does not produce an error, even when freq = NULL.

It appears that hist() is checking for the condition

   !missing(prob)

but needs to add a check for a NULL value

   && !is.null(prob)


[Rd] hist() error when prob=NULL (PR#7682)
tomhopper@comcast.net