You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First, thank you for Shinysurveys - it's great! I hope you can help with this!
I have a matrix of n questions and 5 radio buttons per questions, created using the code below. Instead of hard-coding the questions it reads from a database file so I can change the number of questions, response intervals etc.
Code is attached
It works great if all buttons are checked but...
If a radio button is not checked then it is a missing value in the getSurveyData() dataframe (code below) which throws an error message: "Warning: Error in data.frame: arguments imply differing number of rows: 1, 0"
As I understand it, getSurvey() returns a data frame/tibble where missing values will create a dataframe with columns of uneven length, hence i.e. a value is not inserted in to row... "differing number of rows: 1, 0"
So...
Q.1 How can I prevent the error / uneven col lengths? Or insert an NA or arbitrary value such as 999?
Q.2 Is there a method to check that all questions are answered, a. immediately when a response is missed and b. of checking all responses when the submit button is clicked?
Hey @drgaryhb , how did you solve this? I'm facing a similar challenge with my questions using a matrix. Each question has 4 options and user can select only 2 out of the 4 options, no more no less. When I select only 2 I get the same error you're describing. Would be great to know how you solved it.
Hi Jonathan
First, thank you for Shinysurveys - it's great! I hope you can help with this!
I have a matrix of n questions and 5 radio buttons per questions, created using the code below. Instead of hard-coding the questions it reads from a database file so I can change the number of questions, response intervals etc.
Code is attached
It works great if all buttons are checked but...
If a radio button is not checked then it is a missing value in the getSurveyData() dataframe (code below) which throws an error message: "Warning: Error in data.frame: arguments imply differing number of rows: 1, 0"
As I understand it, getSurvey() returns a data frame/tibble where missing values will create a dataframe with columns of uneven length, hence i.e. a value is not inserted in to row... "differing number of rows: 1, 0"
So...
Q.1 How can I prevent the error / uneven col lengths? Or insert an NA or arbitrary value such as 999?
Q.2 Is there a method to check that all questions are answered, a. immediately when a response is missed and b. of checking all responses when the submit button is clicked?
Thank you in advance,
Kind regards
Gary
app.txt
The text was updated successfully, but these errors were encountered: