Matrix questions #105
Replies: 7 comments 9 replies
-
|
Yes this is definitely on our development radar as I know it is a common question type people need. I saw that a somewhat similar (though older) package that also leverages shiny (shinysurveys) has a matrix question type, so I know this is do-able in shiny. We just need to sit down and figure out how to implement it. Now that we've addressed a lot of more pressing issues (e.g. security & architectural changes in v0.3.0), we'll put this back on our main todo list. @pingfan-hu if you get some time could you look into it? I think searching through how it was implemented in shinysurveys could be helpful. |
Beta Was this translation helpful? Give feedback.
-
|
Hi @StefanMunnes ! The matrix question type is done! You can see the documentation here, and try the demo survey here. |
Beta Was this translation helpful? Give feedback.
-
|
Two questions:
|
Beta Was this translation helpful? Give feedback.
-
|
I agree, it is perhaps a bit confusing to have order swapped around. @pingfan-hu let's discuss. Here's an example to clarify the comment. Our current design is this: sd_question(
type = "matrix",
id = "car_preference",
label = "Please indicate your agreement with the following statements.",
row = c(
"buy_gasoline" = "I'd like to buy a gasoline car",
"buy_ev" = "I'd like to buy an EV"
),
option = c(
"Disagree" = "disagree",
"Neutral" = "neutral",
"Agree" = "agree"
)
)In the This is what the same question would look like if the order was reversed: sd_question(
type = "matrix",
id = "car_preference",
label = "Please indicate your agreement with the following statements.",
row = c(
"I'd like to buy a gasoline car" = "buy_gasoline",
"I'd like to buy an EV" = "buy_ev"
),
option = c(
"Disagree" = "disagree",
"Neutral" = "neutral",
"Agree" = "agree"
)
)I have to agree here with @StefanMunnes, this does feel more consistent to write this way. It should be simple enough to swap around how this works in the code if you agree. As for the Roxygen question, that is probably just a typo. @pingfan-hu can you double check? I think it should say "named vector" instead of list. |
Beta Was this translation helpful? Give feedback.
-
|
Hi folks, yeah I'll fix the issues. I didn't intentionally define the row option is the other way around. I simply didn't notice the mistake. @jhelvy Professor you are right: it's better to write this way. I'll update the source code. |
Beta Was this translation helpful? Give feedback.
-
|
Hi @StefanMunnes ! It's now fixed. An example now looks like this: sd_question(
type = "matrix",
id = "car_preference",
label = "Please indicate your agreement with the following statements.",
row = c(
"I'd like to buy a gasoline car." = "buy_gasoline",
"I'd like to buy an EV." = "buy_ev"
),
option = c(
"Disagree" = "disagree",
"Neutral" = "neutral",
"Agree" = "agree"
)
)As you can see, the Also, I noticed a glitch that the base matrix question id appears in the data sheet. Now it's fixed. Please update to the latest version using the code below and have a test: remotes::install_github("surveydown-dev/surveydown", force = TRUE) |
Beta Was this translation helpful? Give feedback.
-
|
Closing as this is now supported |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
-
Description
Hello and thank you for your great work.
This project looks very promising, and we plan to try and implement it in our workflow. But as far as I see, there is the option for a matrix survey missing for now, right? This is a question type for us in the social science used quite often.
Not sure how to implement it in the backend, but could be question type "matrix" and with a vector input for the argument labels = c("Question 1" = subquest_1, "Question 2" = subquest_2) and so on. The options argument should be than the scale (e.g. 1-10). It could also be beneficial if one could specify in an additional option the range of the scale and just provide start and end point labels (e.g. range = c(1,5), options = c("Very clear", "Very unclear"). And one last point, having an additional and somewhat separated "Don't know" option in the end would also be great.
Hope you think this is useful and easy to implement. And again, a big Thank You!
Beta Was this translation helpful? Give feedback.
All reactions