Commit d88a581e authored by Stephanie's avatar Stephanie
Browse files

Data view of coconut.json works, looking good, cocoquest.json has to be 2-Dimensional --> error

parent f06cdde1
Loading
Loading
Loading
Loading
+24 −10
Original line number Diff line number Diff line
@@ -9,13 +9,12 @@

library(shiny)
library(jsonlite)
#library(DT)
library(DT)

server <- function(input, output) {
  set.seed(122)
  
  output$file1 <- renderDataTable({
    
    inFile <- input$file1
    if (is.null(inFile))
      return(NULL)
@@ -23,6 +22,21 @@ server <- function(input, output) {
    json_data_coco <- fromJSON(paste(inFile$datapath, sep = ""), flatten = TRUE)
    coconut.df <- json_data_coco[["data"]]
    
    datatable(
              cbind(coconut.df), 
              options = list(
                searching = TRUE,
                autoWidth = TRUE,
                rownames = FALSE,
                scroller = TRUE,
                scrollX = TRUE,
                scrollY = "500px",
                fixedHeader = TRUE,
                class = 'cell-border stripe'
              )
    )
  
    
    #coconut.df$timestamp <- anytime((as.numeric(coconut.df$timestamp)/1000))
    
    
@@ -33,11 +47,11 @@ server <- function(input, output) {
    inFile <- input$file2
    if (is.null(inFile))
      return(NULL)
    scrollX=TRUE
    json_data_quest <- fromJSON(paste(inFile$datapath, sep = ""), flatten = TRUE) 
    
    print("json_data_quest ")
    print(json_data_quest)
  
    json_data_quest <- fromJSON(paste(inFile$datapath, sep = ""), flatten = TRUE) 
    #json_data <-map()
    #print(json_for_from)
    
  })