Reposting this with a better reprex. I have a dataset in which one column is a player name and a separate column is a URL. Is it possible to get the URL embedded in the Player's name in a Shiny Reactable table so someone can click on the Player name and be sent to that URL?
Below is what I currently have as my reprex for the app:
library(shiny)
library(tidyverse)
library(dplyr)
library(reactable)
Player <- c("Draymond Green", "Steph Curry", "Alex Caruso")
Line <- c(10.5, 30.5, 11.5)
URL <- c("https://go.metabet.io/bet/nba_game_player_3_pointers_made/475809/bet_rivers_il",
"https://go.metabet.io/bet/nba_game_player_3_pointers_made/475809/bet_rivers_in",
"https://go.metabet.io/bet/nba_game_player_3_pointers_made/475809/draftkings")
sportsbook_odds <- data.frame(Player, Line, URL)
ui <- fluidPage(
sidebarLayout(
sidebarPanel(
selectInput(inputId = "state",
label = "Select a state",
choices = c(
"CO", "IL", "IN", "IA", "MI", "NV", "NH",
"NJ", "OR", "PA", "TN", "VA", "WV"),
selected = "NJ"),
selectInput(inputId = "team",
label = "Team(s) to display",
multiple = TRUE,
choices = c("Select team(s)" = "", "ATL", "BKN", "BOS", "CHA", "CHI", "CLE", "DAL", "DEN",
"DET", "GSW", "HOU", "IND", "LAC", "LAL", "MEM",
"MIA", "MIL", "MIN", "NOP", "NYK", "OKC", "ORL", "PHI",
"PHX", "POR", "SAC", "SAS", "TOR", "UTA", "WAS"))),
mainPanel(reactableOutput("bet_values")
)
)
)
server <- function(input, output) {
output$bet_values <- renderReactable({
reactable(sportsbook_odds, columns = list(
Line = colDef(align = "center",
minWidth = 70)
),
defaultPageSize = 15)
})
}
shinyApp(ui = ui, server = server)
I want it to just show the Player and Line columns while being able to click on the player's name and be brought to the URL in the URL column. Any help would be appreciated!