askpass | R Documentation |
Prompt the user for a password to authenticate or read a protected key.
By default, this function automatically uses the most appropriate method
based on the user platform and front-end. Users or IDEs can override this
and set a custom password entry function via the askpass
option.
askpass(prompt = "Please enter your password: ")
prompt |
the string printed when prompting the user for input. |
By default askpass()
returns NULL
in non-interactive sessions.
(These include knitr runs and testthat tests.)
If you want to force a password prompt in non-interactive sessions,
set the rlib_interactive
option to TRUE
:
options(rlib_interactive = TRUE)
# Prompt user for passwd
pw <- askpass("Please enter your password")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.