text_to_morse_segments: Convert text to a data frame with coordinates of Morse code...

Description Usage Arguments Value Examples

View source: R/morse.R

Description

Convert text to a data frame with coordinates of Morse code segments

Usage

1
text_to_morse_segments(text, line_length = 40)

Arguments

text

The text to convert. Ignores anything except the letters a-z (both upper and lower case), numbers, and spaces.

line_length

Line length to use (number of columns in the resulting matrix). Default is 40.

Value

A tibble::tibble with segment coordinates of Morse code. This is mostly useful for plotting and art.

Examples

1
2
3
4
5
6
library(ggplot2)
text_to_morse_segments("SOS SOS SOS") %>%
  ggplot() +
  geom_segment(aes(x = x, xend = xend, y = y, yend = yend), size = 2)

text_to_morse_segments("SOS SOS SOS", line_length = 10)

xmarquez/morsecode documentation built on Jan. 23, 2022, 12:47 p.m.