insert_cardinal_dir: Insert the cardinal compass direction for given decimal...

Description Usage Arguments Value Examples

View source: R/Cardinal direction.R

Description

This function inserts a new variable "cardinal.dir" into the dataframe passed to it..

Usage

1
insert_cardinal_dir(data, dir_col, abbr = TRUE)

Arguments

data

a dataframe containing the data.

dir_col

direction column to convert to cardinal factor.

abbr

TRUE/FALSE should the results be abbreviated (N versus North)

Value

the original dataframe with the cardinal variable included as a factor

Examples

1
2
3
4
5
insert_cardinal_dir(waves, dir_deg)

#use with dplyr
library(dplyr)
waves %>% insert_cardinal_dir(waves, dir_deg)

towananalytics/tatools documentation built on Jan. 24, 2022, 7:31 p.m.