Skip to content
Back to formatted view

Raw Message

Message-ID: <3EB81F14.58853C53@math.mun.ca>
Date: 2003-05-06T20:46:12Z
From: Paul Y. Peng
Subject: Questons about R capabilities

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