Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
371 views
in Technique[技术] by (71.8m points)

shinydashboard - how to select a column in Rshiny and convert a column into URL

I'm new with shiny and I just want to know the code to convert my URL column into hyperlinks and how to use selectizeInput to select a column in the table. I have checked different questions here but nothing worked.

      tabItem(tabName = "project",
              h2("I will add the project description and institiute logo here")),
      
      tabItem(tabName = "data",
          fluidPage(
              fluidRow(
                box(title = "Fetch Data",selectizeInput(
                  "show_vars",
                  "Columns to show:",
                  choices = colnames(data.input),
                  multiple = TRUE), downloadButton("downloadData", "Download table"), status="primary", solidHeader = T,collapsible = T, width = 2 ),
             box( title = "Data table", status = "primary",solidHeader = T, collapsible = T,width = 10,
                  
                   fluidPage(width=13,height=900,
                          
                          withSpinner(DT::dataTableOutput("data"))
                   )
                  
              ))))
              )))
              
 server <- function(input, output) {
    
    data <- read.csv("Drug-data.csv", header = T)
    
    
    
    output$data <- DT::renderDataTable({
      datatable(cbind.data.frame(data),filter = "top",rownames = F,
                options=list(autoWidth =T,dom='Bfrtrip',paging=T,pageLength=5,scroller=T,scrollX=T,scrollY=700,
                columnDefs = list(list(width = "175px", targets = "_all")),searching=F ),
                extensions = list("Scroller"))
     
      })
  
    
       
    output$downloadData <- downloadHandler(
      filename = function() {
        paste("TECHNOMISE RapidAIM data", Sys.Date(), ".csv", sep="")
      },
      content = function(file) {
        write.csv(data, file)
      }
    )
    runjs('
        var el2 = document.querySelector(".skin-blue");
        el2.className = "skin-blue sidebar-mini";
        ')
  }

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...