create_options {webdeveloper} | R Documentation |
Creates HTML option tags for each position of a list of values and labels by calling HTML5::option(), returning a string of HTML to pass to a select tag through HTML5::select().
Description
Creates HTML option tags for each position of a list of values and labels by calling HTML5::option(), returning a string of HTML to pass to a select tag through HTML5::select().
Usage
create_options(x, selected = c(), add_blank = FALSE)
Arguments
x |
A vector which will become the value/label for each option. If named, names become values. |
selected |
A value in the vector passed to mark as the initially selected option in the select tag. |
add_blank |
Boolean, If TRUE, adds a blank option to the top of x. |
Value
A string, with an option tag each row of x.
Examples
create_options(
x = c("New York", "Los Angeles", "Chicago"),
selected = "Chicago"
)
[Package webdeveloper version 1.0.5 Index]