# R/uniform.R In circular: Circular Statistics

#### Documented in rcircularuniform

```#############################################################
#                                                           #
#   rcircularuniform function                               #
#   Author: Claudio Agostinelli                             #
#   Email: claudio@unive.it                                 #
#   Date: November, 06, 2013                                #
#   Copyright (C) 2013 Claudio Agostinelli                  #
#                                                           #
#   Version 0.1-1                                           #
#############################################################

rcircularuniform <- function(n, control.circular=list()) {
datacircularp <- list(type="angles", units="radians", template="none", modulo="asis", zero=0, rotation="counter")
dc <- control.circular
if (is.null(dc\$type))
dc\$type <- datacircularp\$type
if (is.null(dc\$units))
dc\$units <- datacircularp\$units
if (is.null(dc\$template))
dc\$template <- datacircularp\$template
if (is.null(dc\$modulo))
dc\$modulo <- datacircularp\$modulo
if (is.null(dc\$zero))
dc\$zero <- datacircularp\$zero
if (is.null(dc\$rotation))
dc\$rotation <- datacircularp\$rotation

un <- conversion.circular(circular(un), dc\$units, dc\$type, dc\$template, dc\$modulo, dc\$zero, dc\$rotation)
return(un)
}

un <- stats::runif(n=n, min=0, max=2*pi)
return(un)
}

#############################################################
#                                                           #
#   dcircularuniform function                               #
#   Author: Claudio Agostinelli                             #
#   Email: claudio@unive.it                                 #
#   Date: March, 31, 2009                                   #
#   Copyright (C) 2009 Claudio Agostinelli                  #
#                                                           #
#   Version 0.1                                             #
#############################################################

dcircularuniform <- function (x) {
x <- rep(1/(2*pi), length(x))
return(x)
}
```

## Try the circular package in your browser

Any scripts or data that you put into this service are public.

circular documentation built on April 27, 2022, 1:06 a.m.