Tuesday, November 19, 2013

A Survey Tool Designed Entirely in Shiny Surveying Users of R

http://econometricsbysimulation.shinyapps.io/Survey/I have written a very basic survey tool built entirely in the Shiny package of R.  I hope the tool is useful.  Modifying the survey for your own purposes is trivially easy (I hope).


I have not commented my code so it is pretty messy right now.  You can find the source on GitHub.

In order to run your own survey all you need do is edit the Qlist.csv file.  It contains one row for each question and one column for the question text and additional columns for potential answers (which will enter the radio buttons).  All of the questions will have the default option of "Prefer not to answer" selected.  It should be easy to modify this option as well since you need only find where this text appears in the server.R code.

It should be equally easy to change the introductory message and the accreditation to me, though it would be nice if you left a link somewhere back to me.

I will comment the GitHub files as soon as I have chance.  If people find this tool useful perhaps I will work on improving it.  Please tell me if you find it useful or have suggestions for future improvements!

Please take note that it is really not up in running in a sustainable way since I was recently told that sometimes the ShinyApps.io server must be restarted which means that all of the files are restored to those when the app was originally set up.


http://econometricsbysimulation.shinyapps.io/Survey/

6 comments:

  1. Great idea, that often came to my mind.. but never made it happen. I guess this has a lot of potential also for more elaborate questionnaires. User login for panel survey would be a great feature. Looking forward to see your commented source code... Maybe we can co-operate here / exchange future plans.

    ReplyDelete
    Replies
    1. I would be very happy to have collaborators on such a project. Right now I feel I am forcing round Shiny into a square linear hole but I suspect as the code develops it will become less forced.

      Delete
    2. I added comments to the code.

      Delete
  2. Hi Francis, I was looking for this, took your code as a starting point. There are differences: I use reactiveValues, I don't merge different users' responses within the app but instead save the data with a unique ID (used csv but Rdata would work too), I played around with some of the html tags. It's not finished and there may be bugs too. Anyhow, here it is:

    library("shiny")
    runGist("https://gist.github.com/anonymous/8211224")

    You can see the code at the link above.

    Patrick.

    ReplyDelete
    Replies
    1. Afraid it is not working for me at this time.

      Delete