View source: R/cardinal_direction_to_degrees.R
cardinal_direction_to_degrees | R Documentation |
Function to transform cardinal direction wind directions to decimal degrees.
cardinal_direction_to_degrees(x, north_is = 360)
x |
Character vector with cardinal direction elements. |
north_is |
What decimal degree should north be transformed to? Can be either 360 or 0. |
Numeric vector.
Stuart K. Grange.
# Function uses uppercase and abbreviated cardinal directions x <- c( "N", "NNE", "NE", "ENE", "E", "ESE", "SE", "SSE", "S", "SSW", "SW", "WSW", "W", "WNW", "NW", "NNW" ) # Transform to decimal degrees cardinal_direction_to_degrees(x) # Transform but use 0 degrees for north cardinal_direction_to_degrees(x, north_is = 0)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.