text_to_morse_matrix: Convert text to numeric matrix of Morse code

Description Usage Arguments Value Examples

View source: R/morse.R

Description

Convert text to numeric matrix of Morse code

Usage

1
text_to_morse_matrix(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 matrix with a numeric binary representation of Morse code. Three 1s in a row represent a bar; a 1 represents a dot; a 0 is a separator. Each row of Morse code is separated from the others by a row of zeros. This is mostly useful for plotting and art.

Examples

1
2
text_to_morse_matrix("SOS SOS SOS")
text_to_morse_matrix("SOS SOS SOS", line_length = 10)

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