bsselectR icon indicating copy to clipboard operation
bsselectR copied to clipboard

Extracting "selected" value to use in other R code

Open kppk33 opened this issue 4 years ago • 0 comments

New to this forum and "bsselectR" widget and trying to figure out how to get the value that the user selects to be able to then use that to build data to be displayed from subsequent RMarkdown code.

In the sample code below, what change(s) need to be done to actually extract the choice:

library(bsselectR) quotes <- c("Look deep into nature, and then you will understand everything better.", "A fool thinks himself to be wise, but a wise man knows himself to be a fool.", "My mission in life is not merely to survive, but to thrive; and to do so with some passion, some compassion, some humor, and some style.")

names(quotes) <- c("Einstein", "Shakespeare", "Angelou")

bsselect(quotes, type = "text")

How do I get at the fact that they chose "Shakespeare" for example?

kppk33 avatar Feb 22 '21 18:02 kppk33