I want to create a sequence of random 2D points in R using runif. What is a good way to do that?
This is my current implementation(does not work)
getpoints <- function(n)
{
t <- 1:n;
for (i in 1:n)
{
t[i] <- runif(2,-1,1)
}
return (t)
}
1 Answer