replace C rand() with R::runif()