Hi ,
I was trying to generate random data in R using the runif function. But
I am not sure how do I combine the x and y to get a 2d array/matrix in a
variable z.
As seen below I am getting the same numbers in x as 1 and in y as 2.1
respectively. I would like to get different & random numbers in x & y.
Please let me know.
x <- array(runif(N,1),dim=c(N,1))
> x
[,1]
[1,] 1
[2,] 1
[3,] 1
[4,] 1
[5,] 1
[6,] 1
[7,] 1
[8,] 1
[9,] 1
[10,] 1
> y <- array(2*x + runif(N,1)/10)
> y
[1] 2.1 2.1 2.1 2.1 2.1 2.1 2.1 2.1 2.1 2.1
Thanks & Regards,
Shweta.
[R-gui] Using runif function in R
4 messages · shweta, Dirk Eddelbuettel, Philippe GROSJEAN
2 days later
Shweta, Just three days ago, in a random act of kindness, Charilaos told you in no uncertain terms PS: Not sure what this has to do with GUI though, isn't that more appropriate to R-help instead of r-sig-gui? Which part of this was unclear? Charilaos also told you what you were doing wrong with your call to runif. You are still making the same mistake. Please go back and read his reply. And please stop posting material that has nothing to do with R and GUIs to the list devoted to R and GUIs. Thanks, Dirk
Three out of two people have difficulties with fractions.
An embedded and charset-unspecified text was scrubbed... Name: not available Url: https://stat.ethz.ch/pipermail/r-sig-gui/attachments/20071111/b5265ddb/attachment.pl
Hello All, Sorry, this is my fault! But anyway, please, do post general questions to R-Help mailing list, and reserve R-SIG-GUI for GUI-specific questions on R. Have a nice day, Philippe ..............................................<?}))><........ ) ) ) ) ) ( ( ( ( ( Prof. Philippe Grosjean ) ) ) ) ) ( ( ( ( ( Numerical Ecology of Aquatic Systems ) ) ) ) ) Mons-Hainaut University, Belgium ( ( ( ( ( ..............................................................
shweta wrote:
Dirk, The first time I sent the mail , I got a mail saying that the list moderator has to review it for approval and was not posted. Thats the reason why I sent the mail again (3 days ago) which was posted (and I did get a answer from Charilaos and I also replied apologizing for sending it to R-GUI list instead of a R-general list). But now, it seems that after 3 days the moderator has approved the earlier mail and posted it. I guess I should have canceled the previous posting to avoid this. I hope that now it is clear that I am not making the same mistake again and its the same mail send 3 days ago that is being posted now. Also, I would like to apologize to the members in the R-GUI mailing list, since they all must be getting the same mail 2 times and causing a inconvenience. Regards, Shweta. Dirk Eddelbuettel wrote:
Shweta, Just three days ago, in a random act of kindness, Charilaos told you in no uncertain terms PS: Not sure what this has to do with GUI though, isn't that more appropriate to R-help instead of r-sig-gui? Which part of this was unclear? Charilaos also told you what you were doing wrong with your call to runif. You are still making the same mistake. Please go back and read his reply. And please stop posting material that has nothing to do with R and GUIs to the list devoted to R and GUIs. Thanks, Dirk
[[alternative HTML version deleted]]
_______________________________________________ R-SIG-GUI mailing list R-SIG-GUI at stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-gui