library(tidyverse)
# install.packages("here)
Untitled
R: Import Data
<- readr::read_rds(here::here("data", "processed", "survey_with_labels.rds")) data
R: Transpose Data for OJS
<- data %>% transpose() data_ojs
Exploration
R: Expose Data to JS
ojs_define(data = data_ojs)
ojs_define(varnames = names(data))
ojs_define(qlabels = attributes(data)$variable.labels)
R + OJS: Interaction
OJS: Dropdown
= Inputs.select(varnames,
viewof varname_selected label: "Filter nach:"}
{ )
= Inputs.select(varnames,
viewof filter_val label: "Filter nach:"}
{ )
OJS: Table
= Inputs.table(
viewof tableData ,
data
{sort: varname_selected, required: false
} )