HI,
Use either ?round() or ?signif()
?rnorm(signif(20*(1-0.8)))
#[1]? 1.58079490 -0.03595492 -0.11561782? 0.12951975
?rnorm(signif(20*0.2))
#[1]? 1.70722614? 0.40898103 -2.94663960 -0.09284011
A.K.
----- Original Message -----
From: liuxf <liuxf at math.mcmaster.ca>
To: r-help at r-project.org
Cc:
Sent: Friday, November 30, 2012 4:05 PM
Subject: [R] protentially serious R error
Hi guy,
I have recently encountered a problem while? I was just trying to generate
some random numbers with the function "rnorm", the problem is shown below:
########case 1############
[1] 0.9101742 0.3841854 1.6821761*
I was expecting the 4 cases should do the same job--generate 4 random
numbers. But in case 2 and 4 I only get 3. Has anyone else seen this problem
before? Thanks. (I have tried with other functions i.e "rchisq","rexp" ...)
#######################################################################
One of my colleague also have a problem that we think it might be related
with the problem I addressed above: