[R] Questons about R capabilities

Paul Y. Peng ypeng at math.mun.ca
Tue May 6 22:46:12 CEST 2003


Duncan Murdoch wrote:
> 
> On Tue, 06 May 2003 15:27:20 -0400, you wrote in message
> <seb7d46c.048 at healthsmtp.nycnet>:
> ...
>
> >2)  I am also interested in sampling from a multivariate normal distribution.  I see that R has a command mvrnorm, but when I try to use it, I get a message to the effect that the command is not recognized.  Is there something I must do to enable this command, or is it not available in version 1.7?
> 
> When the help says "mvrnorm(MASS)", that means that the function is in
> the package called "MASS".  You need to execute
> 
>  library(MASS)
> 
> to get that function loaded onto the search path.  You can see which
> packages are already there by executing
> 
>  search()
> 
> Duncan Murdoch

You can also sample a multivariate normal distribution using rmvnorm
from a contributed package "mvtnorm". Execute

	library(mvtnorm)

before using it.

Paul Peng




More information about the R-help mailing list