-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f1f40ff
commit 349c4e1
Showing
354 changed files
with
52 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,30 +3,28 @@ | |
# by Ruud Hortensius (University of Glasgow), part of the Cozmo4HRI project (github.com/comzmo4hri) | ||
# | ||
# This Shiny app displays the data from a emotion validation / classification study | ||
# The user will be able to select the confidence of the ratings, the previous engagement of the raters with robots, and | ||
# The user will be able to select the valence, arousal, and confidence of the ratings, the previous engagement of the raters with robots, and | ||
# the animation category of the Cozmo robot | ||
# | ||
# Send me a message ([email protected]), find me on twitter (@ruudhortensius) or github (github.com/comzmo4hri). | ||
# | ||
# This is one of my first attempts to build a Shiny app: http://shiny.rstudio.com/. Just hit the 'Run App' button above. | ||
# | ||
# | ||
# The code is based and inspired by Lisa DeBruine's code for this shiny app: http://shiny.psy.gla.ac.uk/lmem_sim/ | ||
# The code is based and inspired by Lisa DeBruine's code for this shiny app: http://shiny.psy.gla.ac.uk/lmem_sim/ | ||
# | ||
# | ||
# Ruud's wishlist: | ||
# - Information displayed in the app | ||
# - Density plots normal (lines are weird) | ||
# - Reduce loading time | ||
# - Automatically add new datapoints (link to OSF?) | ||
# - Make it interactive: a click on a datapoint results in the video loaded | ||
# - Select group_by(participant or video_id) | ||
# - Display the animation categories in two columns | ||
|
||
# load the dependencies | ||
library(shiny) | ||
library(shinydashboard) | ||
library(plotly) | ||
library(shinydashboard) | ||
library(plotly) #this is a problem | ||
library(tidyverse) | ||
library(DT) | ||
|
||
|
@@ -85,7 +83,7 @@ ui <- dashboardPage( | |
value = c(1,7), | ||
step = 1) | ||
), | ||
# group input ---- | ||
# group input - animation ---- | ||
box( | ||
title = "Animation group", | ||
solidHeader = TRUE, collapsible = TRUE, collapsed = FALSE, | ||
|
@@ -95,17 +93,19 @@ ui <- dashboardPage( | |
"Animation category of the robot (select one or more):", | ||
b <- unique(DF.main$group) | ||
) | ||
), | ||
box( | ||
title = "Data", | ||
solidHeader = TRUE, collapsible = TRUE, collapsed = FALSE, | ||
width = NULL, | ||
background = "black", | ||
radioButtons("collapse", "Show data at video or individual level:", | ||
list("video_id", "ppn")) | ||
) | ||
)#, | ||
# group input - participant/video ---- | ||
# box( | ||
# title = "Data", | ||
# solidHeader = TRUE, collapsible = TRUE, collapsed = FALSE, | ||
# width = NULL, | ||
# background = "black", | ||
# radioButtons("collapse", "Show data at video or individual level:", | ||
# list("video_id", "ppn")) | ||
# ) | ||
) | ||
), | ||
|
||
###---- dashboardBody | ||
dashboardBody( | ||
tabItems( | ||
|
@@ -118,14 +118,13 @@ ui <- dashboardPage( | |
skin = "black" | ||
) | ||
|
||
|
||
|
||
## server ---- | ||
server <- function(input, output) { | ||
|
||
DF.re <- reactive({ | ||
# filter and group - density ---- | ||
DF.de <- reactive({ | ||
DF.main %>% | ||
group_by_(input$collapse, "group", "animation_name") %>% | ||
dplyr::group_by(ppn, group, animation_name) %>% #input$collapse (to have a reactive grouping) | ||
summarise(valence = mean(valence), | ||
arousal = mean(arousal), | ||
confidence = mean(confidence), | ||
|
@@ -136,9 +135,27 @@ server <- function(input, output) { | |
between(interaction_score, input$filter_interaction[1], input$filter_interaction[2]))%>% | ||
filter(if(length(input$behaviour>0)) group %in% input$behaviour else TRUE) | ||
}) | ||
# filter and group - scatter ---- | ||
|
||
DF.sc <- reactive({ | ||
DF.main %>% | ||
dplyr::group_by(video_id, group, animation_name) %>% #input$collapse (to have a reactive grouping) | ||
summarise(valence = mean(valence), | ||
arousal = mean(arousal), | ||
confidence = mean(confidence), | ||
interaction_score = mean(interaction_score)) %>% | ||
filter(between(valence, input$filter_valence[1], input$filter_valence[2]) & | ||
between(arousal, input$filter_arousal[1], input$filter_arousal[2]) & | ||
between(confidence, input$confidence[1], input$filter_confidence[2]) & | ||
between(interaction_score, input$filter_interaction[1], input$filter_interaction[2]))%>% | ||
filter(if(length(input$behaviour>0)) group %in% input$behaviour else TRUE) | ||
}) | ||
|
||
|
||
|
||
#plot for density | ||
output$densPlot <- renderPlotly({ | ||
DF.re() %>% | ||
DF.de() %>% | ||
ggplot(aes(x=valence, | ||
y=arousal, | ||
#by=animation_name, | ||
|
@@ -159,9 +176,10 @@ server <- function(input, output) { | |
strip.background = element_rect(fill="white")) + | ||
theme(legend.position="none") | ||
}) | ||
|
||
#plot for scatter | ||
output$scatterPlot <- renderPlotly({ | ||
DF.re() %>% | ||
DF.sc() %>% | ||
ggplot(aes(x=valence, | ||
y=arousal, | ||
by = group, | ||
|
@@ -175,13 +193,15 @@ server <- function(input, output) { | |
theme_linedraw() + | ||
coord_fixed(1/1) + | ||
theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank()) + | ||
theme(legend.position="none") + | ||
geom_hline(yintercept=0,color = "grey", size=1, alpha = 0.5) + | ||
geom_vline(xintercept = 0,color = "grey", size=1, alpha = 0.5) | ||
}) | ||
|
||
#table | ||
#Creating table ------- | ||
output$tableDF <- DT::renderDataTable({ | ||
DF.re() | ||
DF.sc() | ||
}) | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.