R coding for random value with contraint -


i want know r code generating 1000 random values x , y between 1 7 such x<=y , numbers identically distributed.

with float number

x <- c() y <- c()   (i in 1:1000){       x[i] <- runif(1, 1, 7)       y[i] <- runif(1, x[i], 7)      // print or want here     } 

with integer number

x <- c() y <- c() (i in 1:1000){       x[i] <- sample(1:7, 1)       y[i] <- sample(x[i]:7, 1)      // print or want here     } 

you can try it.


Comments

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -