Let's say x is of size 100.

x <- rnorm(100)
x[sample(1:100,10)] <- NA 






Kunal Shetty <[EMAIL PROTECTED]>
Sent by: [EMAIL PROTECTED]
10/27/2004 12:59 PM

 
        To:     [EMAIL PROTECTED]
        cc: 
        Subject:        [R] Random number


Dear R- User

I created  two random number sets using rnorm function and calcuted their 
respective means. However now I would like to randomly
replace some values with NA. Thus create my own test data.
Any help or suggestions on this ?


Also wanted to confirm when multiplying two random number vectors x am y 
by matrix..is this how i do it.
A is the matrix

z <- c(x,y)    # x and y the two set of vectors

w <- A%*%Z   # each element in each vector multipled by the matrix .


regards
Kunal

______________________________________________
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

______________________________________________
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to