I am trying to create a survey on shinysurveys. I have an excel file I am reading in and I believe all the columns and formatting are correct. The app launches but there are no questions appearing, just the title. Please help.
library(shiny)
library(shinysurveys)
library(readxl)
library(tidyverse)
df <- readxl::read_xlsx('questions.xlsx') %>%
group_by(question) %>%
nest() %>%
ungroup()
multiQuestions <- df %>%
mutate(page = c(
rep(1, 2),
rep(2, 2))
)
multiQuestions1 <- multiQuestions %>%
unnest(cols = data) %>% as.data.frame()
ui <- fluidPage(
surveyOutput(df = multiQuestions1,
survey_title = "the Big Crypto Personality Survey",
survey_description = "xxxxx",
theme = "#63B8FF"
)
)
server <- function(input, output, session) {
renderSurvey()
}
shinyApp(ui, server)
Data looks like this
structure(list(question = c("What do you hold?", "What do you hold?",
"What do you hold?", "What do you hold?", "What do you hold?",
"What do you hold?", "What do you hold?", "What do you hold?",
"What do you hold?", "What do you hold?", "What is your main holding?",
"What is your main holding?", "What is your main holding?", "What is your main holding?",
"What is your main holding?", "What is your main holding?", "What is your main holding?",
"What is your main holding?", "What is your main holding?", "What is your main holding?",
"What's your age ?", "Which best describes your gender?", "Which best describes your gender?",
"Which best describes your gender?", "Which best describes your gender?"
), option = c("BTC", "ETH", "BNB", "SOL", "ADA", "XRP", "LUNA",
"DOT", "AVAX", "DOGE", "BTC", "ETH", "BNB", "SOL", "ADA", "XRP",
"LUNA", "DOT", "AVAX", "DOGE", "25", "Female", "Male", "Prefer not to say",
"Prefer to self describe"), input_type = c("mc", "mc", "mc",
"mc", "mc", "mc", "mc", "mc", "mc", "mc", "mc", "mc", "mc", "mc",
"mc", "mc", "mc", "mc", "mc", "mc", "numeric", "select", "select",
"select", "select"), input_id = c("overall", "overall", "overall",
"overall", "overall", "overall", "overall", "overall", "overall",
"overall", "main", "main", "main", "main", "main", "main", "main",
"main", "main", "main", "age", "gender", "gender", "gender",
"gender"), dependence = c("NA", "NA", "NA", "NA", "NA", "NA",
"NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA",
"NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA"), dependence_value = c("NA",
"NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA",
"NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA", "NA",
"NA", "NA"), required = c(TRUE, TRUE, TRUE, TRUE, TRUE, TRUE,
TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE,
TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE), page = c(1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2,
2, 2, 2)), row.names = c(NA, -25L), class = "data.frame")