Description Usage Arguments Value Author(s) Examples

View source: R/cardinal_direction_to_degrees.R

Function to transform cardinal direction wind directions to decimal degrees.

1 | ```
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.

1 2 3 4 5 6 7 8 9 10 11 12 13 | ```
# 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)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.