2020# ' have k decimal places. If k = 9, no rounding occurs of native output.
2121# ' Default=9. Value specified by <force.output.to.k.decimal.places> argument
2222# ' in ds.rUnif
23- # ' @return Writes the pseudorandom number vector with the characteristics specified
24- # ' in the function call as a new serverside vector on the data source on which
25- # ' it has been called. Also returns key information to the clientside:
26- # ' the random seed as specified by you in each
27- # ' source + (if requested) the full 626 length random seed vector this generated in
28- # ' each source (see info for the argument <return.full.seed.as.set>). It
29- # ' also returns a vector reporting the length of the pseudorandom vector
30- # ' created in each source.
23+ # ' @return the numeric vector of pseudorandom numbers from a uniform distribution,
24+ # ' rounded to <force.output.to.k.decimal.places> decimal places if that is less
25+ # ' than 9, which is written to the serverside as the object named by the <newobj>
26+ # ' argument of ds.rUnif.
3127# ' @author Paul Burton for DataSHIELD Development Team
28+ # ' @author Tim Cadman, Genomics Coordination Centre, UMCG, Netherlands
3229# ' @export
3330rUnifDS <- function (n , min = 0 , max = 1 , force.output.to.k.decimal.places = 9 ){
3431
@@ -39,13 +36,11 @@ rUnifDS<-function (n, min = 0, max = 1, force.output.to.k.decimal.places=9){
3936# first convert their names into the corresponding active vectors
4037
4138 if (is.character(min )){
42- command.text <- min
43- min <- eval(parse(text = command.text ), envir = parent.frame())
39+ min <- .loadServersideObject(min )
4440 }
4541
4642 if (is.character(max )){
47- command.text <- max
48- max <- eval(parse(text = command.text ), envir = parent.frame())
43+ max <- .loadServersideObject(max )
4944 }
5045
5146 random.number.vector <- stats :: runif(n , min = min , max = max )
0 commit comments