Skip to content
Prev 386115 / 398513 Next

How to correct my error message

On 27/10/2020 3:06 p.m., varin sacha via R-help wrote:
I suspect you intended to concatenate the two parts of z, i.e.

  z <- c(rnorm(n*0.95,2,3), rnorm(n*0.05,2,9))

You shouldn't ignore the warning.

By the way, it's not true for every n that my expression for z will 
always give something of length n.  It would be safer to do the 
calculation as

  m <- round(n*0.95)
  z <- c(rnorm(m,2,3), rnorm(n-m,2,9)

Duncan Murdoch