0

I am working with shiny on Mac. I try to make elements in df$Trail_id clickable. I see a similar one,Convert a column of text URLs into active hyperlinks in Shiny, I try the similar code as,enter image description here

But here is the return error message, Error: 'data' must be 2-dimensional(eg.data frame or matrix).

But TI_result_score is a table which I use read.table to input it before DT::renderDataTable.

No idea what is the problem.

Best Max

  • Without a reproducible example it will be difficult to help you. Have you had a chance to look at [reprex] to set out a question? – Peter May 04 '20 at 20:11

1 Answers1

1

The "escape" argument should be inside a datatable function, not renderDataTable. Moreover, renderDataTable is a function with arguments. So I think that the vector modified by your paste0 is what is taken for the "table" argument by the function, and not the data.frame itself. That would explain the dimension exception thrown.

This should work :

output$TI_scores <- DT::renderDataTable({
  TI_result_scores$Trail_id <- paste0(...) #your code here
  datatable(TI_result_scores,escape=FALSE)
})

Tell us if there is still a problem.

Regards

Levon Ipdjian
  • 786
  • 7
  • 14