Skip to contents

Converts the eight standard compass labels N, NE, E, SE, S, SW, W and NW to bearing angles in radians, where zero is north and angles increase clockwise.

Usage

compass_to_rad(x)

Arguments

x

Character vector of compass labels.

Value

Numeric vector of bearing angles in radians.

Examples

compass_to_rad(c("N", "E", "S", "W"))
#> [1] 0.000000 1.570796 3.141593 4.712389