manipulateWidget (version 0.10.1)

mwPassword: Add a password to a manipulateWidget gadget

Description

Add a password to a manipulateWidget gadget

Usage

mwPassword(value = "", label = NULL, ..., .display = TRUE)

Arguments

value

Default value of the input.

label

Display label for the control. If NULL, the name of the corresponding variable is used.

...

Other arguments passed to functionpasswordInput

.display

expression that evaluates to TRUE or FALSE, indicating when the input control should be shown/hidden.

Value

A function that will generate the input control.

See Also

Other controls: mwCheckboxGroup(), mwCheckbox(), mwDateRange(), mwDate(), mwGroup(), mwNumeric(), mwRadio(), mwSelectize(), mwSelect(), mwSharedValue(), mwSlider(), mwText()

Examples

Run this code
# NOT RUN {
if (require(plotly)) {
  manipulateWidget(
    {
      if (passwd != 'abc123') {
        plot_ly(type = "scatter", mode="markers") %>%
          layout(title = "Wrong password. True password is 'abc123'")
      } else {
        plot_ly(data.frame(x = 1:10, y = rnorm(10)), x=~x, y=~y, type = "scatter", mode = "markers")
      }
    },
    user = mwText(label = "Username"),
    passwd = mwPassword(label = "Password")
  )
}

# }

Run the code above in your browser using DataCamp Workspace