input_text: Create an interactive text or numeric input box.

View source: R/inputs.R

input_textR Documentation

Create an interactive text or numeric input box.

Description

input_numeric only allows numbers and comes with a spin box control. input_text allows any type of input.

Usage

input_text(value, label = "", id = rand_id("text_"), map = identity)

input_numeric(value, label = "", id = rand_id("numeric_"), map = identity)

Arguments

value

Initial value.

label

Display label for the control, or NULL for no label.

id

A unique identifier for this input. Usually generated automatically.

map

A function with single argument x, the value of the control on the client. Returns a modified value.

See Also

Other interactive input: input_checkbox(), input_select(), input_slider()

Examples

fill_text <- input_text(label = "Point color", value = "red")
mtcars %>% ggvis(~wt, ~mpg, fill := fill_text) %>% layer_bars()

size_num <- input_numeric(label = "Point size", value = 25)
mtcars %>% ggvis(~wt, ~mpg, size := size_num) %>% layer_points()

ggvis documentation built on May 29, 2024, 1:12 a.m.