Commit 710f350e authored by Stephanie Wegscheidl's avatar Stephanie Wegscheidl

Multiple charts working, Importing Packages updated and Strucutred Code

parent a5a702bd
This diff is collapsed.
......@@ -77,7 +77,7 @@ ui <- dashboardPage(
#Barchart
textOutput("bar_explain"),
#uiOutput("input_hist_x"),
# uiOutput("input_hist_y"),
#uiOutput("input_hist_y"),
actionButton("check_hist", "add Barchart")
),
......@@ -93,8 +93,8 @@ ui <- dashboardPage(
#Linechart
tabPanel("Linechart",
textOutput("line_explain"),
uiOutput("input_line_x"),
uiOutput("input_line_y"),
# uiOutput("input_line_x"),
# uiOutput("input_line_y"),
actionButton("check_line", "add Linechart")
),
......@@ -103,8 +103,8 @@ ui <- dashboardPage(
# selectInput("scat_x", "x-axis", choices=colnames(coconut.df)),
# selectInput("scat_y", "y-axis", choices=colnames(coconut.df)),
textOutput("scat_explain"),
uiOutput("input_scat_x"),
uiOutput("input_scat_y"),
# uiOutput("input_scat_x"),
# uiOutput("input_scat_y"),
actionButton("check_scat", " add Scatterplot")
),
......@@ -112,7 +112,7 @@ ui <- dashboardPage(
tabPanel("Boxplot",
# selectInput("box_x", "x-axis", choices=colnames(coconut.df)),
textOutput("box_explain"),
uiOutput("input_box_x"),
#uiOutput("input_box_x"),
#uiOutput("input_box_y"),
actionButton("check_box", "add Boxplot")
......@@ -123,7 +123,7 @@ ui <- dashboardPage(
tabPanel("Map",
# selectInput("map_data", "data", choices=colnames(coconut.df)),
textOutput("map_explain"),
uiOutput("input_map"),
#uiOutput("input_map"),
actionButton("check_map", "add Map")
)
)
......
#CoCoQuest Import
#TODO: for all Timestamps not just first and last
Sys.setenv(LANG = "en")
library(ggplot2)
library(jsonlite)
require(GGally)
library(dplyr)
library(rgl)
library(knitr)
library(scales)
library(stringi)
library(RHRV)
library(anytime)
basedir <-"D:\\Dropbox\\UNI\\BAK\\Daten\\CoCoQuest\\"
datadir <- paste(basedir, 'data/', sep = "")
plotdir <- paste(basedir, 'plots/', sep = "")
json_file <- paste(basedir, "study.json", sep="")
json_data_quest <- fromJSON(paste(json_file, sep = ""), flatten = TRUE)
cocoquest.df <- json_data_quest[["data"]]
#parsing timestamp into actual time
#json_data_quest$startTime <-as.numeric(js)
json_data_quest$unix_starttime <- as.numeric(json_data_quest$startTime)/1000
json_data_quest$unix_endtime <- as.numeric(json_data_quest$endTime)/1000
starttime <- anytime(json_data_quest$unix_starttime)
endtime <- anytime(json_data_quest$unix_endtime)
print(starttime)
print(endtime)
Sys.setenv(LANG = "en")
library(ggplot2)
library(jsonlite)
require(GGally)
library(dplyr)
library(rgl)
library(knitr)
library(scales)
library(stringi)
library(RHRV)
library(anytime)
basedir <-"D:\\Dropbox\\UNI\\BAK\\Daten\\CoConUT\\"
datadir <- paste(basedir, 'data/', sep = "")
plotdir <- paste(basedir, 'plots/', sep = "")
#loading data
json_file <- paste(basedir, "g3.json", sep="")
json_data_coco <- fromJSON(paste(json_file, sep = ""), flatten = TRUE)
coconut.df <- json_data_coco[["data"]]
#parsing timestamp into actual time
coconut.df$unix_timestamp <- as.numeric(coconut.df$timestamp)/1000
time <- anytime(coconut.df$unix_timestamp)
# optional
coconut.df$second_counter = (coconut.df$unix_timestamp - min(coconut.df$unix_timestamp))
#extracting everything into variables
lux <- as.numeric(coconut.df$light.lux)
latitude <- as.numeric(coconut.df$gps.latitude)
longitude <- as.numeric(coconut.df$gps.longitude)
bluetooth <- as.numeric(coconut.df$bluetooth.numOfBTDevices)
#print everything
print(coconut.df)
print(time)
print(longitude)
print(latitude)
print(lux)
print(bluetooth)
# getting coordinate-tuples
coordinates<-cbind(latitude,longitude)
print(coordinates)
install.packages("shiny")
install.packages("shinydashboard")
install.packages("jsonlite")
install.packages("DT")
install.packages("anytime")
install.packages("leaflet")
install.packages("timevis")
install.packages("Cairo")
install.packages("grDevices")
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