Quite right, David. I forgot to indicate that MASS needs of course
to be loaded. It's such a useful package that I usually have it
loaded.

Raymond:
When you ask for help with a function in an add-on package
you should indicate that package in your query.

 -Peter Ehlers

David Winsemius wrote:

On Nov 20, 2009, at 1:47 PM, Peter Ehlers wrote:



Raymond Wong wrote:
This is probably simple, but I have a hard time finding the solution. Any help greatly appreciated. I would like to use the results of fitdistr(z,densfun=dweibull,start=list(scale=1,shape=1)) for further processing. How do I assign the values of scale and shape to b and a without manually entering the numbers?


library(MASS)

fd <- fitdistr(z,densfun=dweibull,start=list(scale=1,shape=1))
str(fd)
fd$estimate
fd$estimate[1]

etc

Remember the ever useful str().

Agree! You cannot learn R without knowing to use str().

Could also get more self-documenting code with:

fd$estimate[c("scale", "shape")]


______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to