knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
This package converts text into Morse code, in various formats suitable for graphing and making art. You probably don't need this.
You can install morsecode with:
remotes::install_github("xmarquez/morsecode")
The basic functions all use text_to_*:
library(morsecode) text <- "Hello I am a text" text_to_morse_chars(text)
You can also turn text into binary Morse code:
text_to_morse_numeric(text)
Or a data frame, suitable for graphing:
library(dplyr) library(ggplot2) df <- text_to_morse_segments(text, line_length = 10) df %>% ggplot(aes(x = x, xend = xend, y = y, yend = yend, color = sample(group))) + geom_segment(size = 3, show.legend = FALSE) + theme_void() + scale_color_viridis_c()
Or even sound:
sound <- text_to_morse_sounds(text, pulse_duration = 0.05, play = FALSE) audio::play(sound, rate = 8000)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.