knitr::opts_chunk$set(collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%") library(reohelpers) library(ggplot2) library(dplyr) library(readr)
The goal of reohelpers is to make te reo easier to use in R.
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")
add_macron()
adds macrons appropriately to vowels in te reo words or phrases.macron_vowel()
adds macrons to single or multiple vowels in a given string.meaning()
returns a dataframe of meanings of each word in a given string.Usually the data comes without macron accents
infringements <- read_csv("data/infringements.csv") 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()
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()
If for any reason you need to add macron to a specific character in a string use macron_vowel()
: r macron_vowel("a e i o u")
A quick way to get the meaning of te reo words.
meaning("reo")
Not advised for phrases but it gives you the idea.
meaning("kia ora")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.