create_options | 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().
create_options(x, selected = c(), add_blank = FALSE)
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. |
A string, with an option tag each row of x.
create_options( x = c("New York", "Los Angeles", "Chicago"), selected = "Chicago" )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.