Skip to content

Instantly share code, notes, and snippets.

@jaye-ross
jaye-ross / fibmorse.r
Last active August 29, 2015 14:18
Generate sequences from fibmorse substitution
gen.fibmorse = function(start = c(0), depth = 1){
# check inputs
if(class(start) != "numeric"){
print("Input not a numeric vector!")
stop();
}
for(val in start){
if(!(val %in% c(0,1)) ){
print(paste("Encountered non 0/1 value in vector:",val))
stop()