Skip to content

Instantly share code, notes, and snippets.

@aghaynes
Created June 3, 2016 10:22
Show Gist options
  • Save aghaynes/a39d36a9fd4cd827567a3c20b14cf9f4 to your computer and use it in GitHub Desktop.
Save aghaynes/a39d36a9fd4cd827567a3c20b14cf9f4 to your computer and use it in GitHub Desktop.
Generate a random password using R
passgen <- function(n = 8){
chars <- c(LETTERS, letters, as.character(seq(0,9,1)), "!", "$", ".", "_", "-", "?")
paste0(sample(chars, n), collapse = "")
}
passgen()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment