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
...@@ -9,19 +9,33 @@ ...@@ -9,19 +9,33 @@
library(shiny) library(shiny)
library(jsonlite) library(jsonlite)
#library(DT) library(DT)
server <- function(input, output) { server <- function(input, output) {
set.seed(122) set.seed(122)
output$file1 <- renderDataTable({ output$file1 <- renderDataTable({
inFile <- input$file1
if (is.null(inFile))
return(NULL)
inFile <- input$file1 json_data_coco <- fromJSON(paste(inFile$datapath, sep = ""), flatten = TRUE)
if (is.null(inFile)) coconut.df <- json_data_coco[["data"]]
return(NULL)
json_data_coco <- fromJSON(paste(inFile$datapath, sep = ""), flatten = TRUE) datatable(
coconut.df <- json_data_coco[["data"]] 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)) #coconut.df$timestamp <- anytime((as.numeric(coconut.df$timestamp)/1000))
...@@ -33,11 +47,11 @@ server <- function(input, output) { ...@@ -33,11 +47,11 @@ server <- function(input, output) {
inFile <- input$file2 inFile <- input$file2
if (is.null(inFile)) if (is.null(inFile))
return(NULL) 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)
}) })
......
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