Skip to content

Instantly share code, notes, and snippets.

@shaun-jacks
Created February 18, 2019 00:01
Show Gist options
  • Save shaun-jacks/0f5d7e25587d2b48793d770cc5990db6 to your computer and use it in GitHub Desktop.
Save shaun-jacks/0f5d7e25587d2b48793d770cc5990db6 to your computer and use it in GitHub Desktop.
Example of using DT::datatable() to display facial detection results stored within values$img_res
#### Within ui.R or renderUI() ####
DT::dataTableOutput("results")
#### Within server.R ####
output$results <- DT::renderDataTable({
if (values$analysis_type == "FACE_DETECTION") {
as.data.frame(
list(
joy = values$img_res$joyLikelihood,
sorrow = values$img_res$sorrowLikelihood,
anger = values$img_res$angerLikelihood,
surprise = values$img_res$surpriseLikelihood
)
)
}
}, options = list(scrollX = TRUE, searching = TRUE,
scrollY = "600px", scrollCollapse = TRUE, dom = 'ft'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment