R/rot13.R

Defines functions rot13

Documented in rot13

rot13 <- function(string){
  if(!is.character(string)) stop("character string expected")
  old <- c2s(c(letters, LETTERS))
  new <- c2s(c(letters[14:26], letters[1:13], LETTERS[14:26], LETTERS[1:13]))
  chartr(old = old, new = new, x = string)
}

Try the seqinr package in your browser

Any scripts or data that you put into this service are public.

seqinr documentation built on April 6, 2023, 1:10 a.m.