Open sjone128 opened 3 years ago
@sjone128 you've put together the selectInput()
function perfectly fine, as long as it's in your UI section or ui.R
file.
Typically, what your error message means, is that you called a reactive value like input$my.team
outside of a reactive scope, which are demarcated with the curly braces, e.g. ({ ... })
. Try performing your filter()
operation in your render*({})
function instead.
Let us know if this works!
@jamisoncrawford, thanks for the tip.
I moved the reactive element to the render*({}) function with no success, yet.
Would you please email me your .R file(s) and I can take a better look?
Actually we have a meeting tonight, yeah? @S-Jones-ASU
@jamisoncrawford yep! We do at 3 pm PST.
When adding the reactive object to my code I'm getting this error:
Reactive Object
one.team <- filter(.data = Teams, names == input$my.team)
Error Message
Quitting from lines 73-451 (lab-04-template.rmd) Warning: Error in : Problem with
'rlang:: last_error()' to see where the error occurred.
filter()
input..1
. x Can't access reactive value 'my.team' outside of reactive consumer. i Do you need to wrap inside reactive() or observer()? i Input..1
isnames == input$my.team
. 152:Look a little further
Backtrace:
My guess is that my. team object wasn't created properly but I am not seeing my error. See below:
selectInput( inputId= 'my.team', label='Select a Team', choices= c("Oakland Athletics", "San Diego Padres", "Seattle Mariners", "San Francisco Giants", "New York Mets", "Arizona Diamondbacks", "New York Yankees", "St. Louis Cardinals", "Miami Marlins", "Pittsburgh Pirates", "Philadelphia Phillies", "St. Louis Cardinals", "Chicago White Sox", "Detroit Tigers", "Boston Red Sox", "Baltimore Orioles"), selected= "Arizona Diamondbacks"
)
Thanks for the help!