RandomBearingDraw: Make random draws for bearings

Description Usage Arguments Details Value Author(s) Examples

View source: R/RandomBearingDraw.R

Description

Make random draws for bearings allowing bias towards North-South or East-West

Usage

1
RandomBearingDraw(n = 1, shape_parameter = 1)

Arguments

n

The number of randomly drawn bearings required.

shape_parameter

The shape parameter used as both values in a beta distribution.

Details

Nothing yet.

Value

A vector of bearing(s) of length n.

Author(s)

Graeme T. Lloyd graemetlloyd@gmail.com

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# Set seed for example:
set.seed(21)

# Unbiased random draw (N-S and E-W draws equally likely):
hist(RandomBearingDraw(n = 10000, shape_parameter = 1), xlim=c(0, 360),
  breaks=36, xlab="Bearing (degrees)")

# Random draw biased towards E-W draws:
hist(RandomBearingDraw(n = 10000, shape_parameter = 10), xlim=c(0, 360),
  breaks=36,xlab="Bearing (degrees)")

# Random draw biased towards N-S:
hist(RandomBearingDraw(n = 10000, shape_parameter = 0.1), xlim=c(0, 360),
  breaks=36, xlab="Bearing (degrees)")

laurasoul/dispeRse documentation built on May 25, 2021, 4:50 a.m.