Commit f06cdde1 authored by Stephanie's avatar Stephanie

coconut.json upload and reading works

parent 704e8bcf
......@@ -9,28 +9,36 @@
library(shiny)
library(jsonlite)
#library(DT)
server <- function(input, output) {
set.seed(122)
output$data <- renderTable({
inFile <- input$file1
output$file1 <- renderDataTable({
inFile <- input$file1
if (is.null(inFile))
return(NULL)
json_data_coco <- fromJSON(paste(inFile$datapath, sep = ""), flatten = TRUE)
coconut.df <- json_data_coco[["data"]]
#coconut.df$timestamp <- anytime((as.numeric(coconut.df$timestamp)/1000))
})
output$file2 <- renderDataTable({
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)
#read.csv(inFile$datapath, header = input$header)
print("filename: ")
print(inFile$name)
print("filepath: ")
print(inFile$datapath)
json_file <- paste(inFile$datapath,inFile$name, sep="")
json_data_coco <- fromJSON(paste(json_file, sep = ""), flatten = TRUE)
prin("json_data_coco")
print(json_data_coco)
})
#data<-reactive({
......
......@@ -46,10 +46,14 @@ ui <- dashboardPage(
#show data tab content
tabItem(tabName = "data",
h2("CoConUT Data here:"),
textOutput("data"),
h2("CoCoQuest Data here:")
h2("CoConUT Data here:"),
dataTableOutput("file1"),
h2("CoCoQuest Data here:"),
dataTableOutput("file2")
),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment