Skip to content
Prev 205208 / 398506 Next

Help with function "fitdistr" in "MASS"

Please read the footer of this message.  ?fitdistr says

        x: A numeric vector.

and setting the class does not make it a numeric vector (it is just a 
label).  And fitdistr early on does

     if (missing(x) || length(x) == 0L || mode(x) != "numeric")
         stop("'x' must be a non-empty numeric vector")

so you do have a non-empty numeric vector.

It is likely that your data contains NAs, in which case the quoted 
result is correct.  But despite the posting guide we have no details 
of your 'mydata' and have to guess.
On Sat, 2 Jan 2010, Saji Ren wrote:

            
The help page is not intended to be a very basic statistics/R textbook.