I want to generate random samples from normal distribution such that :
$X \sim \mathcal N(u_1,s_1)$
$Y \sim \mathcal N(u_2,s_2)$
and $\mathrm{cor}(X,Y)=k$ {k is non zero}.
If k=0 then X and Y can be generated easily in R, like :
X <- rnorm(n,mean, sd)
Y <- rnorm(n,mean, sd)
But I donot know how can I generate joint random samples from Normal distribution such that their correlation is not equal to zero.
It would be helpful if you provide procedure with R code.