README.md

reohelpers

The goal of reohelpers is to make te reo easier to use in R.

Installation

reohelpers is not yet released on CRAN but you can install the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("joevalalipin/reohelpers")

Overview

Examples

add_macron()

Usually the data comes without macron accents

infringements <- read_csv("data/infringements.csv")
#> 
#> -- Column specification --------------------------------------------------------
#> cols(
#>   Council = col_character(),
#>   `Council type` = col_character(),
#>   `Infringement notices` = col_double()
#> )
infringements %>% 
  ggplot(aes(x = `Infringement notices`, y = reorder(Council, -`Infringement notices`))) +
  geom_col() +
  labs(title = "Number of infringement notices issued by councils\nin 2018-19",
       x = "",
       y = "",
       caption = "Putake: Manatu Mo Te Taiao") +
  scale_x_continuous(expand = c(0, 0)) +
  theme_classic()
#> Warning: Removed 1 rows containing missing values (position_stack).

Using the function would add appropriate macrons to place names and words

infringements %>% 
  mutate(Council = add_macron(Council)) %>% 
  ggplot(aes(x = `Infringement notices`, y = reorder(Council, -`Infringement notices`))) +
  geom_col() +
  labs(title = "Number of infringement notices issued by councils\nin 2018-19",
       x = "",
       y = "",
       caption = paste0(add_macron("Putake"), ": Ministry for the Environment")) +
  scale_x_continuous(expand = c(0, 0)) +
  theme_classic()
#> Warning: Removed 1 rows containing missing values (position_stack).

macron_vowel()

If for any reason you need to add macron to a specific character in a string use macron_vowel(): ā ē ī ō ū

meaning()

A quick way to get the meaning of te reo words.

meaning("reo")
#>   word         meaning
#> 1  reo language, voice

Not advised for phrases but it gives you the idea.

meaning("kia ora")
#>   word                                                            meaning
#> 1  kia Various uses, meanings. Often not translatable by an English word.
#> 2  ora                                         alive, well, healthy, safe


joevalalipin/reohelpers documentation built on Dec. 21, 2021, 1:19 a.m.