You need to change your second line: range <- c(0.1, 0.5) runif(1, range[1], range[2]) -- View this message in context: http://r.789695.n4.nabble.com/Arguments-of-a-function-tp3387643p3388400.html Sent from the R help mailing list archive at Nabble.com.