├── .gitignore ├── Bounce ├── README.md ├── server.R └── ui.R ├── Ebola-Dynamic ├── server.R └── ui.R ├── Function-Counter ├── README.md ├── server.R └── ui.R ├── ItemGenerator ├── server.R └── ui.R ├── README.md └── Survey ├── Qlist.csv ├── README.md ├── sample-results.csv ├── server.R └── ui.R /.gitignore: -------------------------------------------------------------------------------- 1 | # History files 2 | .Rhistory 3 | 4 | # Example code in package build process 5 | *-Ex.R 6 | -------------------------------------------------------------------------------- /Bounce/README.md: -------------------------------------------------------------------------------- 1 | ## Bounce: A shiny web app 2 | 3 | This is a simple simulation to test the ability of shiny to produce interactive graphs that approximate animation. 4 | 5 | Demonstration of the app in action can be found at: 6 | http://econometricsbysimulation.shinyapps.io/bounce/ 7 | -------------------------------------------------------------------------------- /Bounce/server.R: -------------------------------------------------------------------------------- 1 | library(shiny) 2 | input <- list(rseed=1) 3 | 4 | shinyServer(function(input, output) { 5 | 6 | # Hit counter 7 | output$counter <- 8 | renderText({ 9 | if (!file.exists("counter.Rdata")) counter <- 0 10 | if (file.exists("counter.Rdata")) load(file="counter.Rdata") 11 | counter <- counter + 1 12 | 13 | save(counter, file="counter.Rdata") 14 | paste0("Hits: ", counter) 15 | }) 16 | 17 | mydata <- reactive({ 18 | iI <- input$I # Initial Height (meters) 19 | iB <- input$B # Bounce Efficiency (% of force) 20 | iA <- input$A # Air resistance (% loss of vertical velocity/second) 21 | iG <- input$G # Gravitation constant (m/second) 22 | iT <- input$T # Time Observed (seconds) 23 | iS <- input$S # Smoothing value 24 | 25 | # iB=.9;iT=100;iS=50;iA=0;iI=100;iG=10;iH=1 26 | 27 | y <- iI # Initial position of y 28 | vy <- 0 # Initial velocity of y 29 | 30 | x <- seq(0,iT,1/iS) # Calculate horizontal position 31 | 32 | for (i in seq(1/iS,iT,1/iS)) { 33 | y <- c(max(y[1]+vy[1]/iS,0),y) 34 | 35 | if (y[1]>0) vy.new <- vy[1]-(iG+vy[1]*iA/100)/iS 36 | if (y[1]==0) { 37 | vy.new <- vy[1] 38 | vy.new <- vy.new*-1*iB/100 39 | } 40 | vy <- c(vy.new,vy) 41 | } 42 | 43 | y <- y[length(y):1] 44 | 45 | data.frame(second=seq(0,iT,1/iS), x=x, y=y) 46 | }) 47 | 48 | # Show bounce plot 49 | output$bounceplot <- renderPlot({ 50 | data1 <- mydata() 51 | 52 | x <- data1$x 53 | y <- data1$y 54 | 55 | par(mar = rep(0, 4)) 56 | plot(x,y, type="l") 57 | 58 | px <- c(-10,-10,x,max(x)+10, max(x)+10) 59 | py <- c(-10,y[1],y,tail(y, n = 1), -10) 60 | 61 | polygon(px,py, col=grey(.8)) 62 | 63 | iP <- input$P # Current Position (%) 64 | point <- round(length(x)*(iP+1)/101) 65 | point.lag <- pmax(round(length(x)*(iP+(-3):0)/101),0) 66 | 67 | lines(x[point.lag],y[point.lag], type="p", 68 | cex=1.5, bg=grey(.6)) 69 | lines(x[point],y[point], type="p",cex=3 70 | , bg=grey(.3)) 71 | }) 72 | 73 | }) 74 | -------------------------------------------------------------------------------- /Bounce/ui.R: -------------------------------------------------------------------------------- 1 | library(shiny) 2 | 3 | # Define UI for slider demo application 4 | shinyUI(pageWithSidebar( 5 | 6 | # Application title 7 | headerPanel("Bounce! A simulation"), 8 | 9 | # Sidebar with sliders that demonstrate various available options 10 | sidebarPanel( 11 | 12 | sliderInput("I", "Initial Height (meters):", 13 | min=0, max=500, value=100), 14 | 15 | sliderInput("B", "Bounce Efficiency (% of force):", 16 | min=0, max=100, value=80), 17 | 18 | sliderInput("A", "Air resistance (% loss of vertical velocity/second):", 19 | min=0, max=100, value=1, step=.5), 20 | 21 | sliderInput("G", "Gravitation constant (m/second):", 22 | min=1, max=50, value=10, step=1), 23 | 24 | sliderInput("T", "Time Observed (seconds):", 25 | min=10, max=600, value=60, step=10), 26 | 27 | sliderInput("S", "Smoothing Value (seconds/x):", 28 | min=1, max=20, value=5), 29 | 30 | sliderInput("P", "Current Position (%):", 31 | min=0, max=100, value=0, step=.5, animate=T), 32 | 33 | h5("Created by:"), 34 | tags$a("Econometrics by Simulation", 35 | href="http://www.econometricsbysimulation.com"), 36 | h5("For details on how data is generated:"), 37 | tags$a("Blog Post", 38 | href="http://www.econometricsbysimulation.com/2013/11/a-shiny-app-for-playing-with-ols.html"), 39 | h5("Github Repository:"), 40 | tags$a("OLS-Demo-App", 41 | href="https://github.com/EconometricsBySimulation/OLS-demo-App/"), 42 | h5(textOutput("counter")) 43 | ), 44 | 45 | # Show a table summarizing the values entered 46 | mainPanel(plotOutput("scatter")) 47 | )) 48 | -------------------------------------------------------------------------------- /Ebola-Dynamic/server.R: -------------------------------------------------------------------------------- 1 | library("shiny") 2 | library("ggplot2") 3 | library("scales") 4 | library("rmongodb"); load("mongodb-login.RData") 5 | 6 | # Simulation and Shiny Application of Flue Season Dynamics 7 | shinyServer(function(input, output) { 8 | 9 | mydata <- reactive({ 10 | # Model Parameters: 11 | 12 | IC <- input$IC # Infected 13 | N <- input$N # Total Population 14 | np <- input$np # Time periods 15 | 16 | # Infection Parameters: 17 | # Mortality rate Days 18 | Mr <- input$M 19 | 20 | # Days till resolution 21 | Days <- input$Days 22 | 23 | # Resolution rate per day 24 | Dr <- 1/Days 25 | 26 | # Transmition rate per day (for those contageous) 27 | P <- input$P 28 | 29 | # Social adaption to disease rt=r0d/(1+S)^t 30 | 31 | M <- input$M 32 | DET <- input$DET 33 | K <- input$K 34 | 35 | # Gain in bumber of beds available 36 | bedsv <- input$bed0 37 | for (i in 1:9) bedsv[i+1] <- input[[paste0('bed',i)]]+bedsv[i] 38 | 39 | # Model - Dynamic Change 40 | # Change in Susceptible 41 | DS <- function(t) -P*Sr*S[t]*C[t]/(S[t]+C[t]+1) 42 | 43 | # Change in Contageous 44 | DC <- function(t) P*Sr*S[t]*C[t]/(S[t]+C[t]+1) - 45 | min(C[t]*DET, max(beds-Q[t]*(1-Dr),0)) - C[t]*Dr 46 | 47 | # Change in quarantined 48 | DQ <- function(t) 49 | min(C[t]*DET, max(beds-Q[t]*(1-Dr),0)) -Q[t]*Dr 50 | 51 | # Change in deceased 52 | DD <- function(t) (Q[t]+C[t])*Mr*Dr 53 | 54 | # Change in recovered 55 | DR <- function(t) (Q[t]+C[t])*(1-Mr)*Dr 56 | 57 | # Change in detection over time 58 | Et <- function(t) detI+(1-(1-detG)^t)*(detM-detI) 59 | 60 | S <- C <- Q <- D <- R <- E <- B <- r0 <- rep(NA, np+1) 61 | 62 | # Initial populations: 63 | S[1] <- N-IC # Sesceptible population 64 | C[1] <- IC # Contageous 65 | Q[1] <- 0 # Quarentined 66 | R[1] <- 0 # Recovered 67 | D[1] <- 0 # Deceased 68 | B[1] <- input$bed0 69 | r0[1] <- P*Days 70 | 71 | # Loop through periods 72 | for (t in 1:np) { 73 | # Detection rate of unifected per day 74 | B[t+1] <- beds <- bedsv[ceiling(t/30)] 75 | Sr <- (1+K)^(-t) 76 | r0[t+1] <- P*Sr*Days*(S[t])/(S[t]+C[t]) 77 | 78 | # Calculate the change values 79 | dS <- DS(t) 80 | dC <- DC(t) 81 | dQ <- DQ(t) 82 | dR <- DR(t) 83 | dD <- DD(t) 84 | 85 | # Change the total populations 86 | S[t+1] <- S[t] + dS 87 | C[t+1] <- C[t] + dC 88 | Q[t+1] <- Q[t] + dQ 89 | R[t+1] <- R[t] + dR 90 | D[t+1] <- D[t] + dD 91 | 92 | } 93 | 94 | # Turn the results into a table 95 | long <- data.frame( 96 | Period=rep((0:np),6), 97 | Population = c(S, C, Q, R, D, B), 98 | Indicator=rep(c("Susceptible", 99 | "Contageous", 100 | "Quarentined", 101 | "Recovered", 102 | "Deceased", 103 | "Beds"), 104 | each=np+1)) 105 | wide <- cbind(S, C, Q, R, D, B, r0) 106 | 107 | list(long=long, wide=wide) 108 | 109 | }) 110 | 111 | output$r0 <- 112 | renderText(paste('Initial r0:', input$P*input$Days)) 113 | output$LDET <- 114 | renderText(paste('Likelihood of detection:', round(1-(1-input$DET)^input$Days,2))) 115 | 116 | output$datatable <- 117 | renderTable({ 118 | Tdata <- mydata()[["wide"]] 119 | Tdata <- cbind(day=1:nrow(Tdata), Tdata) 120 | Tdata[seq(1, nrow(Tdata), length.out=30),] 121 | }) 122 | 123 | output$graph1 <- renderPlot({ 124 | long <- mydata()[["long"]] 125 | p <- ggplot(long[long$Indicator %in% input$Indicators,], 126 | aes(x=Period, y=Population, group=Indicator)) 127 | p <- p + 128 | geom_line(aes(colour = Indicator), size=1, alpha=.75) + 129 | ggtitle("Population Totals")+ 130 | scale_x_continuous(name="Days")+ 131 | scale_y_continuous(labels = comma, name="") 132 | print(p) 133 | }) 134 | 135 | output$graph2 <- renderPlot({ 136 | 137 | data2 <- mydata()[["wide"]] 138 | 139 | change <- data2[-1,]-data2[-nrow(data2),] 140 | 141 | long <- data.frame( 142 | Period=rep((1:nrow(change)),7), 143 | Population = c(change), 144 | Indicator=rep(c("Susceptible", 145 | "Contageous", 146 | "Quarentined", 147 | "Recovered", 148 | "Deceased", 149 | "Beds", 150 | "r0"), 151 | each=nrow(change))) 152 | 153 | p <- ggplot(long[long$Indicator %in% input$Indicators,], 154 | aes(x=Period, y=Population, group=Indicator)) 155 | p <- p + geom_line(aes(colour = Indicator), size=1,alpha=.75) + 156 | ggtitle("Change in Population")+ 157 | scale_x_continuous(name="Days")+ 158 | scale_y_continuous(labels = comma, name="") 159 | print(p) 160 | }) 161 | 162 | output$counter <- 163 | renderText({ 164 | 165 | db <- "econometricsbysimulation" 166 | 167 | mongo <- 168 | mongo.create(host = host , 169 | db = db, 170 | username = username, 171 | password = password) 172 | # Please note, as is this code will not work for you. 173 | # I have saved my host, db, username, and password in 174 | # RData file load("mongodb-login.RData") in the same 175 | # directory as my shiny app. 176 | 177 | collection <- "ebola_hit" 178 | 179 | namespace <- paste(db, collection, sep=".") 180 | 181 | # insert entry 182 | b <- mongo.bson.from.list(list(platform="MongoHQ", 183 | app="counter", date=toString(Sys.Date()))) 184 | ok <- mongo.insert(mongo, namespace, b) 185 | 186 | # query database for hit count 187 | buf <- mongo.bson.buffer.create() 188 | mongo.bson.buffer.append(buf, "app", "counter") 189 | query <- mongo.bson.from.buffer(buf) 190 | 191 | counter <- mongo.count(mongo, namespace, query) 192 | 193 | paste0("Hits: ", counter) 194 | }) 195 | 196 | }) 197 | -------------------------------------------------------------------------------- /Ebola-Dynamic/ui.R: -------------------------------------------------------------------------------- 1 | library(shiny) 2 | 3 | # Define UI for slider demo application 4 | shinyUI(pageWithSidebar( 5 | 6 | # Application title 7 | headerPanel("Ebola Model"), 8 | 9 | # Sidebar with sliders that demonstrate various available options 10 | sidebarPanel( 11 | 12 | tags$h3("Data Generation"), 13 | 14 | sliderInput("N", "Population:", 15 | min=10^4, max=10^7, value=10^6, step=10^4), 16 | 17 | sliderInput("IC", "Initial Infected Detected:", 18 | min=0, max=10^3, value=100, step=1), 19 | 20 | sliderInput("np", "Number of days:", 21 | min=30, max=360, value=270, step=10), 22 | 23 | textOutput("r0"), 24 | 25 | sliderInput("P", "Transmition rate:", 26 | min=.01, max=.25, value=.081, step=.001), 27 | 28 | sliderInput("Days", "Contageous Period (Days):", 29 | min=0, max=40, value=18, step=1), 30 | 31 | sliderInput("M", "Moralitity Rate:", 32 | min=0, max=1, value=.6, step=.05), 33 | 34 | sliderInput("K", "Social 'adaption' to reduce infection:", 35 | min=-.0012, max=.0012, value=.0003, step=.0003), 36 | 37 | sliderInput("DET", "Daily Detection Rate:", 38 | min=0, max=1, value=.07, step=.01), 39 | textOutput("LDET"), 40 | 41 | sliderInput("bed0", "# of Quarantine Beds Available Initially:", 42 | min=0, max=10^3, value=0, step=10), 43 | 44 | sliderInput("bed1", "# of New Quarantine Beds Available at 1 months:", 45 | min=0, max=10^3, value=10, step=10), 46 | 47 | sliderInput("bed2", "# of New Quarantine Beds Available at 2 months:", 48 | min=0, max=10^3, value=50, step=10), 49 | 50 | sliderInput("bed3", "# of New Quarantine Beds Available at 3 months:", 51 | min=0, max=10^3, value=50, step=10), 52 | 53 | sliderInput("bed4", "# of New Quarantine Beds Available at 4 months:", 54 | min=0, max=10^3, value=50, step=10), 55 | 56 | sliderInput("bed5", "# of New Quarantine Beds Available at 5 months:", 57 | min=0, max=10^3, value=50, step=10), 58 | 59 | sliderInput("bed6", "# of New Quarantine Beds Available at 6 months:", 60 | min=0, max=10^3, value=50, step=10), 61 | 62 | sliderInput("bed7", "# of New Quarantine Beds Available at 7 months:", 63 | min=0, max=10^3, value=50, step=10), 64 | 65 | sliderInput("bed8", "# of New Quarantine Beds Available at 8 months:", 66 | min=0, max=10^3, value=100, step=10), 67 | 68 | sliderInput("bed9", "# of New Quarantine Beds Available at 9 months:", 69 | min=0, max=10^3, value=100, step=10), 70 | 71 | br(), 72 | 73 | h5("Created by:"), 74 | tags$a("Econometrics by Simulation", 75 | href="http://www.econometricsbysimulation.com"), 76 | h5("For details on how data is generated"), 77 | tags$a("Blog Post", 78 | href=""), 79 | h5(textOutput("counter")) 80 | 81 | ), 82 | 83 | # Show a table summarizing the values entered 84 | mainPanel( 85 | checkboxGroupInput("Indicators", "", 86 | c("Susceptible", 87 | "Contageous", 88 | "Recovered", 89 | "Deceased", 90 | "Quarentined", 91 | "Beds"), 92 | selected=c( 93 | "Contageous", 94 | "Quarentined", 95 | "Recovered", 96 | "Deceased", 97 | "Beds"), 98 | inline=TRUE), 99 | plotOutput("graph1"), 100 | plotOutput("graph2"), 101 | tableOutput("datatable") 102 | ) 103 | )) 104 | -------------------------------------------------------------------------------- /Function-Counter/README.md: -------------------------------------------------------------------------------- 1 | This is a small shiny program to create an App that returns information about the frequency of use of R functions. 2 | 3 | For more information see the blog post at: 4 | http://www.econometricsbysimulation.com/2014/3/fcount.html 5 | 6 | See the app in action at: 7 | http://econometricsbysimulation.shinyapps.io/FCount 8 | -------------------------------------------------------------------------------- /Function-Counter/server.R: -------------------------------------------------------------------------------- 1 | library(shiny) 2 | 3 | load("freqTable.Rdata") 4 | 5 | # Load the CRAN library 6 | library(rmongodb) 7 | 8 | load("mongodb-login.RData") 9 | 10 | db <- "econometricsbysimulation" 11 | 12 | shinyServer(function(input, output) { 13 | 14 | # Hit counter using mongo database service. 15 | # For more information: 16 | # http://www.econometricsbysimulation.com/2014/02/using-mongohq-to-build-shiny-hit-counter.html 17 | output$counter <- renderText({ 18 | 19 | mongo <- mongo.create(host=host , db=db, username=username, password=password) 20 | 21 | # Load the collection. In this case the collection is. 22 | collection <- "Fcounter" 23 | namespace <- paste(db, collection, sep=".") 24 | 25 | # Insert a simple entry into the collection at the time of log in 26 | # listing the date that the collection was accessed. 27 | b <- mongo.bson.from.list(list(platform="MongoHQ", 28 | app="counter", date=toString(Sys.Date()))) 29 | ok <- mongo.insert(mongo, namespace, b) 30 | 31 | # Now we query the database for the number of hits 32 | buf <- mongo.bson.buffer.create() 33 | mongo.bson.buffer.append(buf, "app", "counter") 34 | query <- mongo.bson.from.buffer(buf) 35 | counter <- mongo.count(mongo, namespace, query) 36 | 37 | # I am not really sure if this is a good way of doing this 38 | # at all. 39 | 40 | # I send the number of hits to the shiny counter as a renderText 41 | # reactive function 42 | paste0("Hits: ", counter) 43 | }) 44 | 45 | # Show function list in plot 46 | output$frequencydisplay <- renderPlot({ 47 | tsearch <- input$tsearch 48 | # freqTable displays 49 | FS = input$FS[1] 50 | FSmax <- input$FS[2] 51 | ndisplay <- input$ndisplay 52 | 53 | nrange <- FS:FSmax 54 | if ((length(nrange)>ndisplay)&(!ndisplay==0)) 55 | nrange <- seq(FS, FSmax, length.out=ndisplay) 56 | 57 | par(mar=c(2,2,4,1)) 58 | 59 | ylist <- freqTable[nrange,2] 60 | 61 | if (input$logY) ylist <- log(freqTable[nrange,2]) 62 | 63 | plot(nrange, type="n", 64 | ylist, 65 | ylim=c(0,max(ylist)*1.2), 66 | main="Function Count") 67 | 68 | for (i in 1:length(nrange)) text(nrange[i], ylist[i], 69 | freqTable[nrange[i],1], 70 | srt=90, adj = c(0,.35)) 71 | 72 | }) 73 | 74 | # Show function list 75 | output$nchardisplay <- renderPlot({ 76 | tsearch <- input$tsearch 77 | FS = input$FS[1] 78 | FSmax <- input$FS[2] 79 | ndisplay <- input$ndisplay 80 | 81 | nrange <- FS:FSmax 82 | 83 | par(mar=c(2,2,4,1)) 84 | 85 | ylist <- freqTable[nrange,4] 86 | 87 | plot(nrange, 88 | ylist, 89 | main="Function Character Length") 90 | 91 | }) 92 | 93 | # Provide 94 | output$Rangewarning <- renderText({ 95 | FS = input$FS[1] 96 | FSmax <- input$FS[2] 97 | ndisplay <- input$ndisplay 98 | 99 | returner <- "Display the entire range selected." 100 | 101 | if (FSmax-FS>ndisplay) 102 | returner <- "Because the display range is greater than number of 103 | functions set to display only a sampling of display range 104 | of length equal the number to display will be shown." 105 | if (ndisplay==0) 106 | returner <- "Display entire range if display range is set to 0." 107 | 108 | returner 109 | }) 110 | 111 | # Create a table to display the information for searched function. 112 | output$tresult <- renderTable({ 113 | tsearch <- input$tsearch 114 | returner <- freqTable[freqTable[,1]==tsearch,] 115 | rownames(returner) <- NULL 116 | if (length(returner)==0) returner <- NULL 117 | returner 118 | }) 119 | 120 | }) 121 | -------------------------------------------------------------------------------- /Function-Counter/ui.R: -------------------------------------------------------------------------------- 1 | library(shiny) 2 | 3 | # Define UI for slider demo application 4 | shinyUI(pageWithSidebar( 5 | 6 | # Application title 7 | headerPanel("Function Counter for R"), 8 | 9 | # Sidebar with sliders that demonstrate various available options 10 | sidebarPanel( 11 | 12 | sliderInput("FS", "Display Range", 13 | min=1, max=5000, value=c(1,50)), 14 | 15 | sliderInput("ndisplay", "# of Functions to Display", 16 | min=0, max=200, value=50), 17 | 18 | checkboxInput("logY", "Display log of wordcount", value = FALSE), 19 | 20 | textInput("tsearch", "Search for function", "list"), 21 | tableOutput("tresult"), 22 | 23 | h6('Thank you to John Myles White for compiling a list of word frequencies (in 2009) from source files for all CRAN Packages.'), 24 | tags$a("John Myles White", 25 | href="http://www.johnmyleswhite.com/notebook/2009/12/07/r-function-usage-frequencies/"), 26 | h5("Created by:"), 27 | tags$a("Econometrics by Simulation", 28 | href="http://www.econometricsbysimulation.com"), 29 | h5("For details on how applications was generated:"), 30 | tags$a("Blog Post", 31 | href="http://www.econometricsbysimulation.com/2014/3/fcount.html"), 32 | h5("Github Repository:"), 33 | tags$a("Function Counter", 34 | href="https://github.com/EconometricsBySimulation/Shiny-Demos/blob/master/Function-Counter/"), 35 | h5(textOutput("counter")), 36 | HTML('') 37 | ), 38 | 39 | # Show a table summarizing the values entered 40 | mainPanel(plotOutput("frequencydisplay"), 41 | textOutput("Rangewarning"), 42 | plotOutput("nchardisplay") 43 | ) 44 | )) 45 | -------------------------------------------------------------------------------- /ItemGenerator/server.R: -------------------------------------------------------------------------------- 1 | library("shiny") 2 | library("stringr") 3 | 4 | 5 | shinyServer(function(input, output) { 6 | 7 | # Hit counter 8 | output$counter <- 9 | renderText({ 10 | if (!file.exists("counter.Rdata")) counter <- 0 11 | if (file.exists("counter.Rdata")) load(file="counter.Rdata") 12 | counter <- counter <<- counter + 1 13 | 14 | save(counter, file="counter.Rdata") 15 | paste0("Hits: ", counter) 16 | }) 17 | 18 | items <- reactive({ 19 | textOut <- "" 20 | 21 | mainlist <- strsplit(input$Stem, ";")[[1]] 22 | answerlist <- strsplit(input$answer, ";")[[1]] 23 | nanswer <- length(answerlist) 24 | 25 | for (t in 1:8) assign(paste0("t",t), 26 | strsplit(input[[(paste0("t",t))]],";")[[1]]) 27 | 28 | items <- list() 29 | for (i in 1:input$nitems) { 30 | items[i] <- paste(c( 31 | paste0(i,":",sample(mainlist,1)), 32 | paste(letters[1:nanswer],". ", 33 | sample(answerlist,nanswer), 34 | collapse="\n", sep=""),"\n" 35 | ), collapse="\n") 36 | 37 | for (l in 1:10) for (t in 1:8) 38 | items[i] <- gsub(paste0("#",t),sample(get(paste0("t",t)),1),items[i]) 39 | } 40 | items 41 | }) 42 | 43 | 44 | output$newitems <- renderText({ 45 | textOut <- paste(items(), collapse="\n") 46 | 47 | txt <- c('
',textOut,
48 | '
')
49 | paste(txt, collapse="\n")
50 |
51 | })
52 |
53 | output$CSI <- renderText({
54 |
55 | igenerate <- items()
56 |
57 | CSIlist <- NULL
58 |
59 | for (i in 1:(length(igenerate)-1)) {
60 |
61 | igenerate1 <- igenerate[[i]]
62 | igenerate2 <- igenerate[[i+1]]
63 |
64 | for (i in c("\n","a\\.", "b\\.", "c\\.", "d\\.", "e\\.", ":")) {
65 | igenerate1 <- gsub(i, " ", igenerate1)
66 | igenerate2 <- gsub(i, " ", igenerate2)
67 | }
68 |
69 | igenerate1 <- strsplit(igenerate1, " ")[[1]]
70 | igenerate2 <- strsplit(igenerate2, " ")[[1]]
71 |
72 | igenerate1 <- igenerate1[igenerate1!=""]
73 | igenerate2 <- igenerate2[igenerate2!=""]
74 |
75 | t.vect <- unlist(igenerate1,igenerate2)
76 |
77 | t.vect <- t.vect[!t.vect==""]
78 |
79 | wtcount1 <- wtcount2 <- rep(0,length(t.vect))
80 |
81 | for (ii in 1:length(t.vect)) wtcount1[ii] <- sum(str_count(igenerate1, t.vect[ii]))
82 | for (ii in 1:length(t.vect)) wtcount2[ii] <- sum(str_count(igenerate2, t.vect[ii]))
83 |
84 | denominator <- (sum(wtcount1^2))^.5 * (sum(wtcount2^2))^.5
85 | numerator <- sum(wtcount1*wtcount2)
86 | CSIlist <- c(CSIlist, numerator/denominator)
87 | }
88 |
89 | c("CSI", CSIlist)
90 | })
91 | })
92 |
--------------------------------------------------------------------------------
/ItemGenerator/ui.R:
--------------------------------------------------------------------------------
1 | # setwd("C:/Dropbox/Shiny_R/IGen")
2 | library(shiny)
3 |
4 | # Define UI for slider demo application
5 | shinyUI(pageWithSidebar(
6 |
7 | # Application title
8 | headerPanel("Item Generation Tool v.01"),
9 |
10 | sidebarPanel(
11 | h6("Elements are seperated by ';' and places where elements are imported
12 | are indicated by '#element number'."),
13 | textInput("Stem", "Stem","Question Stem 1 #1;Question Stem 2: 1 #1 and 2 #2"),
14 | textInput("t1", "#1","Element 1a; Element 1b"),
15 | textInput("t2", "#2","Element 2a; Element 2b"),
16 | textInput("t3", "#3"," "),
17 | textInput("t4", "#4"," "),
18 | textInput("t5", "#5"," "),
19 | textInput("t6", "#6"," "),
20 | textInput("t7", "#7"," "),
21 | textInput("t8", "#8"," "),
22 | textInput("answer", "Answer","Choice1*;Choice2;Choice3"),
23 |
24 | # This is intentionally an empty object.
25 | h6(textOutput("save.results")),
26 | h5("Created by:"),
27 | tags$a("Econometrics by Simulation",
28 | href="http://www.econometricsbysimulation.com"),
29 | h5("Github Repository:"),
30 | tags$a("Item Generator",
31 | href=paste0("https://github.com/EconometricsBySimulation/",
32 | "Shiny-Demos/tree/master/ItemGenerator")),
33 | # Display the page counter text.
34 | h5(textOutput("counter"))
35 | ),
36 |
37 | # Show a table summarizing the values entered
38 | mainPanel(
39 | sliderInput("nitems", "Number of Items to Generate",
40 | min=5, max=100, value=5),
41 | submitButton("Generate Items"),
42 | textOutput("CSI"),
43 | h5(htmlOutput("newitems"))
44 | )
45 | ))
46 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | Shiny-Demos
2 | ===========
3 |
4 | In this repo I will keep various experiments using Shiny
5 |
--------------------------------------------------------------------------------
/Survey/Qlist.csv:
--------------------------------------------------------------------------------
1 | Qnum,Question,Answer1,Answer2,Answer3,Answer4,Answer5
2 | 1,My knowledge of R is best described as:,None,Basic,Moderate,Advanced,Expert
3 | 2,Professionally I am best described as:,Professor,Graduate Student,Undergraduate Student,Industry/Professional,Unemployed
4 | 3,My age is:,less than 25,26-35,36-45,46-55,56 or older
5 | 4,I read the blog aggrogator R-bloggers:,never,daily,weekly,monthly,
6 | 5,My knowledge of statistics/econometrics/psychometrics is best described as:,None,Basic,Moderate,Advanced,Expert
7 | 6,I read the blog EconometricsBySimulation:,never,daily,weekly,monthly,
8 | 7,My favorite color is:,red,blue,green,pink,orange
9 | 8,My gender is:,Male,Female,,,
10 | 9,My area of research can best be described as:,Statistics,Econometrics,Psychometrics,Data Analysis,Graphical Design
11 | 10,My knowledge of R Shiny is best described as:,None,Basic,Moderate,Advanced,Expert
12 |
--------------------------------------------------------------------------------
/Survey/README.md:
--------------------------------------------------------------------------------
1 | # Shiny-Survey Tool v.01
2 |
3 | Sorry, none of the code has any comments in it yet. I will come back and do that soon (hopefully). I wanted to get it out as quickly as possible less I might not get it out at all.
4 |
5 | To add questions or possible answers just modify the Qlist.csv document.
6 |
7 | You can add more columns for additional potential answers. Any answer slots left "" will be ignored.
8 |
9 | You can find a demonstration at:
10 | http://econometricsbysimulation.shinyapps.io/Survey/
11 |
--------------------------------------------------------------------------------
/Survey/sample-results.csv:
--------------------------------------------------------------------------------
1 | ,My knowledge of R is best described as:,Professionally I am best described as:,My age is:,I read the blog aggrogator R-bloggers:,My knowledge of statistics/econometrics/psychometrics is best described as:,I read the blog EconometricsBySimulation:,My favorite color is:,My gender is:,My area of research can best be described as:,My knowledge of R Shiny is best described as:,What... is the air-speed velocity of an unladen swallow?
2 | User 1,Advanced,Graduate Student,26-35,daily,Advanced,daily,green,Male,Psychometrics,Moderate,What do you mean? An African or European swallow?
3 | User 2,Moderate,Graduate Student,26-35,daily,Moderate,daily,blue,Male,Data Analysis,None,What do you mean? An African or European swallow?
4 | User 3,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Moderate,weekly,green,Female,Psychometrics,Expert,What do you mean? An African or European swallow?
5 | User 4,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer
6 | User 5,Moderate,Professor,56 or older,daily,Advanced,never,blue,Male,Econometrics,None,~50 MPH
7 | User 6,Moderate,Industry/Professional,26-35,monthly,None,monthly,blue,Male,Prefer not to answer,Moderate,What do you mean? An African or European swallow?
8 | User 7,Advanced,Industry/Professional,36-45,daily,Moderate,monthly,orange,Male,Data Analysis,Prefer not to answer,What do you mean? An African or European swallow?
9 | User 8,Moderate,Industry/Professional,26-35,daily,Basic,weekly,blue,Male,Data Analysis,Moderate,What do you mean? An African or European swallow?
10 | User 9,Advanced,Undergraduate Student,less than 25,weekly,Moderate,weekly,blue,Male,Statistics,Moderate,What do you mean? An African or European swallow?
11 | User 10,Advanced,Industry/Professional,Prefer not to answer,,,,,,Econometrics,None,Prefer not to answer
12 | User 11,Advanced,Industry/Professional,26-35,daily,Advanced,never,green,Male,Data Analysis,Moderate,I don't know!
13 | User 12,Moderate,Industry/Professional,26-35,daily,Advanced,monthly,blue,Prefer not to answer,Data Analysis,Basic,Prefer not to answer
14 | User 13,Advanced,Industry/Professional,less than 25,daily,Advanced,never,green,Male,Statistics,Basic,~50 MPH
15 | User 14,Expert,Professor,36-45,daily,Expert,monthly,Prefer not to answer,Male,Econometrics,Basic,I don't know!
16 | User 15,Expert,Professor,26-35,daily,Advanced,never,green,Male,Data Analysis,Basic,What do you mean? An African or European swallow?
17 | User 16,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Expert,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer
18 | User 17,Basic,Graduate Student,Graduate Student,,,,,,,,I don't know!
19 | User 18,Basic,Graduate Student,26-35,daily,Basic,Prefer not to answer,blue,Male,Data Analysis,Basic,I don't know!
20 | User 19,Advanced,Professor,26-35,weekly,Moderate,monthly,Prefer not to answer,Male,Data Analysis,Basic,What do you mean? An African or European swallow?
21 | User 20,Prefer not to answer,,,,,,blue,Male,Prefer not to answer,None,What do you mean? An African or European swallow?
22 | User 21,Advanced,Prefer not to answer,36-45,,,,,Male,Data Analysis,Moderate,I don't know!
23 | User 22,Advanced,Industry/Professional,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer
24 | User 23,Advanced,Industry/Professional,26-35,weekly,Moderate,never,blue,Male,Statistics,Basic,I don't know!
25 | User 24,Moderate,Graduate Student,26-35,weekly,Basic,never,blue,Male,Data Analysis,None,~50 MPH
26 | User 25,Basic,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer
27 | User 26,Moderate,Undergraduate Student,36-45,daily,None,weekly,blue,Female,Statistics,Moderate,~50 MPH
28 | User 27,Advanced,Prefer not to answer,36-45,daily,Expert,weekly,red,Male,Data Analysis,Basic,~50 MPH
29 | User 28,Advanced,Graduate Student,26-35,weekly,Advanced,never,blue,Male,Data Analysis,Moderate,Prefer not to answer
30 | User 29,Advanced,Industry/Professional,36-45,daily,Advanced,never,blue,Male,Statistics,Basic,I don't know!
31 | User 30,Moderate,Prefer not to answer,Prefer not to answer,weekly,Moderate,daily,red,Male,Data Analysis,Basic,What do you mean? An African or European swallow?
32 | User 31,Moderate,Prefer not to answer,Prefer not to answer,weekly,Moderate,daily,red,Male,Data Analysis,Basic,I don't know!
33 | User 32,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer
34 | User 33,Advanced,Graduate Student,less than 25,daily,Advanced,weekly,blue,Female,Statistics,Moderate,What do you mean? An African or European swallow?
35 | User 34,Advanced,Industry/Professional,36-45,daily,Advanced,never,red,Male,Data Analysis,None,What do you mean? An African or European swallow?
36 | User 35,Moderate,Industry/Professional,46-55,weekly,Moderate,weekly,red,Female,Statistics,Basic,~50 MPH
37 | User 36,Moderate,Industry/Professional,46-55,weekly,Moderate,weekly,red,Female,Statistics,Basic,What do you mean? An African or European swallow?
38 | User 37,Moderate,Professor,46-55,daily,Moderate,Prefer not to answer,blue,Male,Prefer not to answer,None,What do you mean? An African or European swallow?
39 | User 38,Moderate,Moderate,26-35,26-35,Prefer not to answer,daily,green,Male,Graphical Design,Moderate,What do you mean? An African or European swallow?
40 | User 39,Advanced,Industry/Professional,26-35,daily,Moderate,weekly,blue,Male,Econometrics,None,I don't know!
41 | User 40,Advanced,Industry/Professional,36-45,weekly,Basic,Prefer not to answer,blue,Male,Prefer not to answer,Advanced,I don't know!
42 | User 41,Advanced,Industry/Professional,36-45,weekly,Basic,never,green,Male,Data Analysis,Moderate,What do you mean? An African or European swallow?
43 | User 42,Advanced,Graduate Student,26-35,daily,Moderate,never,orange,Male,Data Analysis,None,What do you mean? An African or European swallow?
44 | User 43,Basic,Industry/Professional,46-55,monthly,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer
45 | User 44,,Industry/Professional,26-35,daily,Basic,never,blue,Male,Data Analysis,Basic,I don't know!
46 | User 45,Moderate,Undergraduate Student,26-35,daily,Basic,never,green,Male,Data Analysis,Basic,What do you mean? An African or European swallow?
47 | User 46,Advanced,Graduate Student,less than 25,daily,Prefer not to answer,never,orange,Male,Prefer not to answer,None,I don't know!
48 | User 47,Moderate,Graduate Student,26-35,weekly,Moderate,never,Prefer not to answer,Male,Data Analysis,None,I don't know!
49 | User 48,Moderate,Graduate Student,26-35,weekly,Moderate,never,Prefer not to answer,Male,Data Analysis,None,What do you mean? An African or European swallow?
50 | User 49,Moderate,Graduate Student,26-35,weekly,Moderate,never,Prefer not to answer,Male,Data Analysis,None,I don't know!
51 | User 50,Expert,Professor,36-45,weekly,Advanced,monthly,orange,Male,Data Analysis,Prefer not to answer,Prefer not to answer
52 | User 51,Expert,Graduate Student,Prefer not to answer,weekly,Moderate,weekly,pink,Female,Data Analysis,Advanced,What do you mean? An African or European swallow?
53 | User 52,Expert,Graduate Student,26-35,daily,Moderate,weekly,red,Male,Prefer not to answer,Basic,I don't know!
54 | User 53,Basic,Industry/Professional,26-35,daily,Basic,weekly,orange,Male,Data Analysis,Moderate,What do you mean? An African or European swallow?
55 | User 54,Moderate,Industry/Professional,36-45,daily,Advanced,monthly,green,Male,Psychometrics,Basic,What do you mean? An African or European swallow?
56 | User 55,,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer
57 | User 56,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Male,Statistics,Basic,What do you mean? An African or European swallow?
58 | User 57,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer
59 | User 58,Moderate,Industry/Professional,26-35,weekly,Advanced,never,blue,Male,Statistics,Prefer not to answer,I don't know!
60 | User 59,Moderate,Industry/Professional,26-35,weekly,Advanced,never,blue,Male,Statistics,Basic,What do you mean? An African or European swallow?
61 | User 60,Moderate,Industry/Professional,Prefer not to answer,,,,,,,,I don't know!
62 | User 61,Advanced,Industry/Professional,36-45,daily,None,Prefer not to answer,blue,Male,Data Analysis,None,I don't know!
63 | User 62,Advanced,Industry/Professional,36-45,daily,None,never,Prefer not to answer,Male,Data Analysis,Basic,What do you mean? An African or European swallow?
64 | User 63,Advanced,Graduate Student,26-35,daily,Moderate,never,pink,Male,Data Analysis,Advanced,What do you mean? An African or European swallow?
65 | User 64,Moderate,Professor,36-45,daily,Basic,never,red,Male,Data Analysis,None,I don't know!
66 | User 65,Basic,Industry/Professional,36-45,weekly,Basic,monthly,Prefer not to answer,Male,Prefer not to answer,Basic,Prefer not to answer
67 | User 66,Moderate,Graduate Student,26-35,daily,Moderate,never,Prefer not to answer,Male,Data Analysis,None,Prefer not to answer
68 | User 67,Advanced,Undergraduate Student,less than 25,daily,Moderate,never,blue,Male,Data Analysis,Expert,I don't know!
69 | User 68,Expert,Graduate Student,26-35,daily,Advanced,never,blue,Male,Data Analysis,Moderate,I don't know!
70 | User 69,Prefer not to answer,Prefer not to answer,Prefer not to answer,,,,blue,Male,Data Analysis,Advanced,Prefer not to answer
71 | User 70,Prefer not to answer,Prefer not to answer,less than 25,Prefer not to answer,Prefer not to answer,,blue,Male,Data Analysis,Advanced,~50 MPH
72 | User 71,Advanced,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,orange,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer
73 | User 72,Advanced,Industry/Professional,46-55,daily,Basic,monthly,green,Male,Statistics,Advanced,I don't know!
74 | User 73,Advanced,Industry/Professional,46-55,daily,Prefer not to answer,monthly,green,Male,Data Analysis,Moderate,Prefer not to answer
75 | User 74,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer
76 | User 75,Advanced,Graduate Student,less than 25,daily,Moderate,weekly,blue,Male,Prefer not to answer,Basic,I don't know!
77 | User 76,,,,,,,,,Data Analysis,Advanced,I don't know!
78 | User 77,None,Undergraduate Student,36-45,daily,Moderate,daily,green,Male,Psychometrics,Advanced,~50 MPH
79 | User 78,Prefer not to answer,,,,,,,,Statistics,Basic,Prefer not to answer
80 | User 79,Advanced,Graduate Student,46-55,weekly,Moderate,never,Prefer not to answer,Male,Prefer not to answer,Basic,I don't know!
81 | User 80,Expert,Graduate Student,26-35,weekly,Expert,never,blue,Male,Data Analysis,Moderate,I don't know!
82 | User 81,Moderate,Industry/Professional,36-45,daily,Moderate,monthly,Prefer not to answer,Male,Data Analysis,Basic,I don't know!
83 | User 82,Moderate,Industry/Professional,36-45,daily,Moderate,monthly,Prefer not to answer,Male,Data Analysis,Basic,What do you mean? An African or European swallow?
84 | User 83,,,,,,,,,,,I don't know!
85 | User 84,Basic,Industry/Professional,36-45,weekly,Advanced,monthly,red,Male,Statistics,None,What do you mean? An African or European swallow?
86 | User 85,Advanced,Industry/Professional,46-55,daily,Advanced,never,Prefer not to answer,Male,Data Analysis,Moderate,What do you mean? An African or European swallow?
87 | User 86,Advanced,Industry/Professional,46-55,daily,Advanced,never,blue,Male,Data Analysis,None,Prefer not to answer
88 | User 87,Basic,Professor,36-45,daily,Moderate,never,green,Male,Data Analysis,None,What do you mean? An African or European swallow?
89 | User 88,Moderate,Industry/Professional,less than 25,daily,Prefer not to answer,,blue,Male,Data Analysis,None,Prefer not to answer
90 | User 89,Moderate,Industry/Professional,less than 25,daily,Moderate,never,Prefer not to answer,Male,Data Analysis,None,I don't know!
91 | User 90,Moderate,Industry/Professional,less than 25,daily,Moderate,never,Prefer not to answer,Male,Data Analysis,Basic,What do you mean? An African or European swallow?
92 | User 91,Advanced,Industry/Professional,26-35,daily,Moderate,never,blue,Male,Prefer not to answer,None,What do you mean? An African or European swallow?
93 | User 92,,Industry/Professional,26-35,daily,Advanced,Prefer not to answer,blue,Male,Data Analysis,Advanced,Prefer not to answer
94 | User 93,Basic,Graduate Student,26-35,daily,Moderate,weekly,blue,Male,Data Analysis,Moderate,Prefer not to answer
95 | User 94,Prefer not to answer,,,,,,red,Male,Data Analysis,Moderate,What do you mean? An African or European swallow?
96 | User 95,,,,,,,blue,Male,Psychometrics,Basic,What do you mean? An African or European swallow?
97 | User 96,Advanced,Undergraduate Student,36-45,daily,daily,weekly,weekly,Male,Data Analysis,Data Analysis,I don't know!
98 | User 97,Moderate,Professor,36-45,daily,Prefer not to answer,never,red,Male,Statistics,None,What do you mean? An African or European swallow?
99 | User 98,Moderate,Professor,36-45,daily,Moderate,never,green,Male,Prefer not to answer,None,Prefer not to answer
100 | User 99,Expert,Industry/Professional,36-45,daily,Moderate,never,Prefer not to answer,Male,Data Analysis,Advanced,What do you mean? An African or European swallow?
101 | User 100,Advanced,Industry/Professional,26-35,daily,Advanced,never,orange,Male,Statistics,Basic,What do you mean? An African or European swallow?
102 | User 101,None,Prefer not to answer,36-45,Prefer not to answer,Expert,daily,pink,Female,Econometrics,Moderate,What do you mean? An African or European swallow?
103 | User 102,,Industry/Professional,26-35,Prefer not to answer,,,,,,Basic,What do you mean? An African or European swallow?
104 | User 103,Advanced,Prefer not to answer,,,,,,,Data Analysis,Basic,What do you mean? An African or European swallow?
105 | User 104,Advanced,Industry/Professional,26-35,daily,Moderate,never,blue,Male,Data Analysis,Basic,I don't know!
106 | User 105,Moderate,Professor,26-35,daily,Moderate,never,blue,Male,Data Analysis,None,I don't know!
107 | User 106,Advanced,Graduate Student,26-35,daily,Advanced,never,blue,Prefer not to answer,Data Analysis,Basic,~50 MPH
108 | User 107,Advanced,Graduate Student,26-35,daily,Advanced,never,blue,Male,Psychometrics,Basic,What do you mean? An African or European swallow?
109 | User 108,,,,,,,,,Data Analysis,None,What do you mean? An African or European swallow?
110 | User 109,Advanced,Industry/Professional,36-45,daily,Advanced,daily,orange,Male,Data Analysis,Moderate,I don't know!
111 | User 110,Advanced,Graduate Student,26-35,weekly,Advanced,Prefer not to answer,Prefer not to answer,Male,Statistics,None,Prefer not to answer
112 | User 111,Advanced,Professor,56 or older,daily,Advanced,never,Prefer not to answer,Male,Statistics,Advanced,Prefer not to answer
113 | User 112,Advanced,Professor,56 or older,daily,Advanced,never,Prefer not to answer,Male,Statistics,Advanced,What do you mean? An African or European swallow?
114 | User 113,Prefer not to answer,,,,,,,,,,
115 | User 114,Advanced,Graduate Student,26-35,weekly,Moderate,never,pink,Male,Statistics,Advanced,What do you mean? An African or European swallow?
116 | User 115,Moderate,Industry/Professional,26-35,daily,Basic,Prefer not to answer,red,Male,Data Analysis,None,What do you mean? An African or European swallow?
117 | User 116,Advanced,Industry/Professional,26-35,daily,Advanced,Prefer not to answer,Prefer not to answer,Male,Prefer not to answer,Advanced,What do you mean? An African or European swallow?
118 | User 117,Advanced,Industry/Professional,26-35,daily,Advanced,Prefer not to answer,Prefer not to answer,Male,Prefer not to answer,Moderate,Prefer not to answer
119 | User 118,Expert,Industry/Professional,36-45,daily,Advanced,never,blue,Male,Psychometrics,Basic,What do you mean? An African or European swallow?
120 | User 119,Expert,Industry/Professional,36-45,daily,Advanced,never,blue,Male,Psychometrics,Basic,What do you mean? An African or European swallow?
121 | User 120,Prefer not to answer,Graduate Student,56 or older,daily,None,never,pink,Male,Econometrics,Expert,~50 MPH
122 | User 121,Basic,Graduate Student,36-45,monthly,Advanced,monthly,green,Female,Psychometrics,Moderate,~50 MPH
123 | User 122,Advanced,Prefer not to answer,,,,,,,,Moderate,What do you mean? An African or European swallow?
124 | User 123,Advanced,Professor,46-55,daily,Advanced,never,orange,Male,Data Analysis,Basic,I don't know!
125 | User 124,Prefer not to answer,Industry/Professional,26-35,daily,Advanced,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer
126 | User 125,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer
127 | User 126,Moderate,Industry/Professional,36-45,daily,Prefer not to answer,weekly,blue,Male,Data Analysis,Basic,I don't know!
128 | User 127,Moderate,Industry/Professional,36-45,daily,Expert,Prefer not to answer,red,Male,Econometrics,None,What do you mean? An African or European swallow?
129 | User 128,Advanced,Industry/Professional,26-35,daily,Basic,never,Prefer not to answer,Prefer not to answer,Prefer not to answer,None,What do you mean? An African or European swallow?
130 | User 129,Advanced,Industry/Professional,26-35,weekly,Moderate,never,blue,Male,Data Analysis,Basic,What do you mean? An African or European swallow?
131 | User 130,Advanced,Industry/Professional,26-35,daily,Advanced,never,orange,Male,Statistics,Moderate,~50 MPH
132 | User 131,Moderate,Industry/Professional,46-55,weekly,Moderate,weekly,green,Male,Statistics,Basic,What do you mean? An African or European swallow?
133 | User 132,Advanced,Graduate Student,26-35,daily,Moderate,never,green,Male,Data Analysis,Basic,What do you mean? An African or European swallow?
134 | User 133,Advanced,Graduate Student,26-35,daily,Moderate,never,green,Male,Data Analysis,Basic,What do you mean? An African or European swallow?
135 | User 134,Advanced,Industry/Professional,26-35,daily,Basic,monthly,blue,Male,Data Analysis,Moderate,What do you mean? An African or European swallow?
136 | User 135,,,,,,,,,,,What do you mean? An African or European swallow?
137 | User 136,Moderate,Industry/Professional,56 or older,daily,Moderate,monthly,red,Male,Econometrics,Moderate,I don't know!
138 | User 137,Advanced,Industry/Professional,36-45,monthly,Moderate,never,blue,Male,Statistics,None,I don't know!
139 | User 138,Advanced,Industry/Professional,36-45,monthly,Moderate,never,blue,Male,Data Analysis,Advanced,I don't know!
140 | User 139,Basic,Professor,46-55,weekly,Basic,never,Prefer not to answer,Male,Graphical Design,None,I don't know!
141 | User 140,Moderate,Industry/Professional,36-45,weekly,Advanced,never,green,Male,Data Analysis,Basic,What do you mean? An African or European swallow?
142 | User 141,Moderate,Industry/Professional,36-45,daily,Moderate,never,blue,Male,Data Analysis,Moderate,~50 MPH
143 | User 142,,,36-45,weekly,Advanced,never,blue,Male,Statistics,Basic,What do you mean? An African or European swallow?
144 | User 143,Moderate,Professor,36-45,daily,Moderate,never,Prefer not to answer,Prefer not to answer,Prefer not to answer,None,Prefer not to answer
145 | User 144,Advanced,Industry/Professional,26-35,Prefer not to answer,Moderate,monthly,green,Male,Statistics,Advanced,I don't know!
146 | User 145,Advanced,Industry/Professional,26-35,weekly,Advanced,never,blue,Male,Statistics,Advanced,I don't know!
147 | User 146,None,Professor,less than 25,never,None,daily,blue,Female,Econometrics,Basic,I don't know!
148 | User 147,Advanced,Professor,36-45,daily,Moderate,never,red,Prefer not to answer,Prefer not to answer,None,Prefer not to answer
149 | User 148,Moderate,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Data Analysis,Prefer not to answer,Prefer not to answer
150 | User 149,Advanced,Prefer not to answer,,,,,,,,None,I don't know!
151 | User 150,Advanced,Industry/Professional,26-35,daily,Moderate,monthly,red,Male,Data Analysis,Basic,What do you mean? An African or European swallow?
152 | User 151,Expert,Industry/Professional,26-35,daily,Advanced,never,red,Male,Data Analysis,None,I don't know!
153 | User 152,Basic,Graduate Student,less than 25,daily,Moderate,never,blue,Male,Psychometrics,Basic,What do you mean? An African or European swallow?
154 | User 153,Advanced,Professor,36-45,daily,Expert,weekly,blue,Male,Statistics,None,What do you mean? An African or European swallow?
155 | User 154,Advanced,Industry/Professional,36-45,daily,Moderate,monthly,orange,Male,Prefer not to answer,Basic,What do you mean? An African or European swallow?
156 | User 155,Advanced,Industry/Professional,26-35,weekly,Advanced,never,green,Male,Statistics,Moderate,I don't know!
157 | User 156,Moderate,Professor,36-45,daily,Moderate,Prefer not to answer,blue,Male,Data Analysis,Advanced,What do you mean? An African or European swallow?
158 | User 157,,,,,,,,,,,
159 | User 158,Advanced,Industry/Professional,26-35,monthly,Expert,monthly,green,Male,Data Analysis,None,I don't know!
160 | User 159,Advanced,Industry/Professional,26-35,monthly,Expert,never,blue,Prefer not to answer,Data Analysis,Basic,What do you mean? An African or European swallow?
161 | User 160,Advanced,Industry/Professional,26-35,monthly,Expert,never,blue,Male,Data Analysis,Basic,What do you mean? An African or European swallow?
162 | User 161,Prefer not to answer,Industry/Professional,46-55,monthly,Moderate,weekly,blue,Male,Psychometrics,Advanced,Prefer not to answer
163 | User 162,Advanced,Prefer not to answer,26-35,weekly,Advanced,never,green,Male,Psychometrics,Advanced,What do you mean? An African or European swallow?
164 | User 163,Basic,Unemployed,56 or older,daily,Advanced,never,blue,Male,Data Analysis,Basic,I don't know!
165 | User 164,Advanced,Graduate Student,26-35,daily,Advanced,never,blue,Male,Data Analysis,Basic,I don't know!
166 | User 165,Moderate,Graduate Student,26-35,weekly,Advanced,never,green,Male,Data Analysis,Basic,I don't know!
167 | User 166,Moderate,Industry/Professional,26-35,weekly,Moderate,never,blue,Male,Data Analysis,Advanced,I don't know!
168 | User 167,Advanced,Industry/Professional,36-45,daily,Advanced,monthly,Prefer not to answer,Male,Statistics,Basic,What do you mean? An African or European swallow?
169 | User 168,Advanced,Industry/Professional,26-35,daily,Advanced,never,blue,Male,Data Analysis,Basic,~50 MPH
170 | User 169,Advanced,Graduate Student,less than 25,weekly,Advanced,never,green,Male,Statistics,Basic,What do you mean? An African or European swallow?
171 | User 170,Moderate,Industry/Professional,46-55,daily,Advanced,never,orange,Male,Data Analysis,None,What do you mean? An African or European swallow?
172 | User 171,Advanced,Graduate Student,26-35,monthly,Advanced,monthly,green,Male,Prefer not to answer,None,What do you mean? An African or European swallow?
173 | User 172,Basic,Industry/Professional,46-55,daily,Basic,never,Prefer not to answer,Male,Data Analysis,Basic,What do you mean? An African or European swallow?
174 | User 173,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer
175 | User 174,Advanced,Graduate Student,26-35,weekly,Advanced,Prefer not to answer,green,Male,Statistics,Moderate,What do you mean? An African or European swallow?
176 | User 175,Advanced,Graduate Student,26-35,monthly,Advanced,weekly,green,Male,Statistics,Advanced,What do you mean? An African or European swallow?
177 | User 176,None,Professor,36-45,monthly,Moderate,weekly,green,Male,Econometrics,Advanced,~50 MPH
178 | User 177,Advanced,Industry/Professional,26-35,weekly,Moderate,never,red,Male,Data Analysis,Advanced,What do you mean? An African or European swallow?
179 | User 178,,,less than 25,less than 25,Advanced,Prefer not to answer,Prefer not to answer,Prefer not to answer,Econometrics,Econometrics,Econometrics
180 | User 179,,,less than 25,less than 25,Advanced,Prefer not to answer,Prefer not to answer,Prefer not to answer,Econometrics,Econometrics,Econometrics
181 | User 180,Advanced,Industry/Professional,26-35,daily,Advanced,monthly,green,Male,Data Analysis,None,~50 MPH
182 | User 181,Moderate,Industry/Professional,46-55,daily,Moderate,weekly,green,Male,Data Analysis,Basic,~50 MPH
183 | User 182,Moderate,Industry/Professional,36-45,monthly,Basic,never,red,Prefer not to answer,Data Analysis,None,What do you mean? An African or European swallow?
184 | User 183,Advanced,Industry/Professional,36-45,weekly,Expert,monthly,green,Male,Data Analysis,Basic,What do you mean? An African or European swallow?
185 | User 184,,,,,,,,,,,
186 | User 185,Moderate,Industry/Professional,36-45,daily,Moderate,never,red,Male,Data Analysis,Basic,What do you mean? An African or European swallow?
187 | User 186,Moderate,Graduate Student,less than 25,weekly,Prefer not to answer,Prefer not to answer,orange,Prefer not to answer,Data Analysis,Prefer not to answer,~50 MPH
188 | User 187,None,Graduate Student,36-45,weekly,Moderate,weekly,green,Male,Data Analysis,Advanced,~50 MPH
189 | User 188,Expert,Industry/Professional,46-55,daily,Expert,monthly,blue,Male,Data Analysis,Moderate,What do you mean? An African or European swallow?
190 | User 189,Moderate,Industry/Professional,less than 25,daily,Moderate,Prefer not to answer,blue,Male,Econometrics,None,I don't know!
191 | User 190,Basic,Industry/Professional,56 or older,daily,Prefer not to answer,never,orange,Male,Data Analysis,Basic,I don't know!
192 | User 191,,,,,,daily,green,Male,Data Analysis,Basic,I don't know!
193 | User 192,Advanced,Industry/Professional,26-35,weekly,Advanced,never,blue,Male,Data Analysis,Basic,What do you mean? An African or European swallow?
194 | User 193,Prefer not to answer,,,,,,,,,,~50 MPH
195 | User 194,Moderate,Industry/Professional,36-45,daily,Basic,never,red,Male,Data Analysis,Basic,I don't know!
196 | User 195,Moderate,Industry/Professional,26-35,daily,Moderate,Prefer not to answer,blue,Male,Statistics,Basic,~50 MPH
197 | User 196,Advanced,Industry/Professional,less than 25,daily,Moderate,never,green,Male,Data Analysis,Basic,I don't know!
198 | User 197,Expert,Professor,36-45,daily,Expert,weekly,Prefer not to answer,Prefer not to answer,Psychometrics,Moderate,Prefer not to answer
199 | User 198,Advanced,Industry/Professional,26-35,daily,Moderate,monthly,pink,Male,Data Analysis,Basic,What do you mean? An African or European swallow?
200 | User 199,Basic,Industry/Professional,26-35,weekly,Moderate,Prefer not to answer,orange,Male,Data Analysis,Basic,I don't know!
201 | User 200,Expert,Graduate Student,26-35,daily,Advanced,Prefer not to answer,blue,Female,Data Analysis,Moderate,Prefer not to answer
202 | User 201,Expert,Graduate Student,26-35,weekly,Advanced,monthly,blue,Male,Data Analysis,Basic,I don't know!
203 | User 202,Advanced,Industry/Professional,46-55,daily,Advanced,monthly,blue,Male,Econometrics,Basic,I don't know!
204 | User 203,Moderate,Industry/Professional,36-45,weekly,Advanced,never,red,Male,Statistics,Basic,Prefer not to answer
205 | User 204,Moderate,Industry/Professional,36-45,daily,Advanced,weekly,Prefer not to answer,Prefer not to answer,Prefer not to answer,None,I don't know!
206 | User 205,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer
207 | User 206,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer
208 | User 207,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer
209 | User 208,Advanced,Industry/Professional,36-45,Prefer not to answer,,monthly,blue,Male,Prefer not to answer,Advanced,Prefer not to answer
210 | User 209,Advanced,Industry/Professional,36-45,daily,Advanced,never,green,Male,Data Analysis,Basic,Prefer not to answer
211 | User 210,Advanced,Industry/Professional,36-45,daily,Advanced,never,green,Male,Data Analysis,Basic,~50 MPH
212 | User 211,Expert,Professor,less than 25,never,Expert,never,red,Prefer not to answer,Statistics,None,What do you mean? An African or European swallow?
213 | User 212,Advanced,Industry/Professional,46-55,daily,Advanced,weekly,Prefer not to answer,Male,Data Analysis,Basic,What do you mean? An African or European swallow?
214 | User 213,Advanced,Industry/Professional,46-55,daily,Advanced,weekly,blue,Male,Data Analysis,Moderate,I don't know!
215 | User 214,Advanced,Industry/Professional,46-55,daily,Advanced,weekly,blue,Male,Data Analysis,Moderate,What do you mean? An African or European swallow?
216 | User 215,Moderate,Industry/Professional,26-35,daily,Basic,never,green,Male,Data Analysis,None,~50 MPH
217 | User 216,Moderate,Industry/Professional,26-35,daily,Moderate,monthly,blue,Male,Data Analysis,Moderate,What do you mean? An African or European swallow?
218 | User 217,Moderate,Industry/Professional,56 or older,daily,Moderate,never,blue,Male,Statistics,Basic,I don't know!
219 | User 218,Advanced,Graduate Student,26-35,weekly,,,,,,,What do you mean? An African or European swallow?
220 | User 219,Advanced,Graduate Student,26-35,weekly,Basic,never,blue,Female,Data Analysis,Basic,What do you mean? An African or European swallow?
221 | User 220,Advanced,Industry/Professional,26-35,daily,Moderate,never,green,Male,Data Analysis,Advanced,What do you mean? An African or European swallow?
222 | User 221,,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Psychometrics,Advanced,I don't know!
223 | User 222,Basic,Graduate Student,less than 25,daily,Moderate,never,Prefer not to answer,Male,Prefer not to answer,Prefer not to answer,What do you mean? An African or European swallow?
224 | User 223,Moderate,Industry/Professional,36-45,daily,Advanced,never,green,Male,Econometrics,Basic,I don't know!
225 | User 224,Moderate,Industry/Professional,26-35,daily,Basic,never,red,Male,Data Analysis,None,What do you mean? An African or European swallow?
226 | User 225,Moderate,Industry/Professional,26-35,daily,Basic,never,blue,Male,Data Analysis,Basic,What do you mean? An African or European swallow?
227 | User 226,,,36-45,daily,Moderate,weekly,green,Female,Psychometrics,Moderate,What do you mean? An African or European swallow?
228 | User 227,Basic,Prefer not to answer,36-45,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer
229 | User 228,Moderate,Graduate Student,26-35,daily,Moderate,never,green,Male,Prefer not to answer,Basic,I don't know!
230 | User 229,Moderate,Graduate Student,26-35,daily,Moderate,never,pink,Male,Data Analysis,None,Prefer not to answer
231 | User 230,Moderate,Graduate Student,26-35,daily,Moderate,never,pink,Male,Data Analysis,None,Prefer not to answer
232 | User 231,Basic,Graduate Student,36-45,daily,Moderate,never,blue,Male,Data Analysis,Basic,What do you mean? An African or European swallow?
233 | User 232,Advanced,Graduate Student,26-35,daily,Advanced,monthly,blue,Male,Econometrics,None,What do you mean? An African or European swallow?
234 | User 233,Advanced,Graduate Student,36-45,monthly,Advanced,weekly,pink,Female,Data Analysis,Expert,~50 MPH
235 | User 234,Basic,Industry/Professional,36-45,daily,Advanced,never,blue,Male,Psychometrics,Basic,I don't know!
236 | User 235,Basic,Industry/Professional,36-45,daily,Basic,never,green,Male,Data Analysis,None,What do you mean? An African or European swallow?
237 | User 236,Basic,Industry/Professional,26-35,daily,Moderate,never,green,Male,Data Analysis,None,What do you mean? An African or European swallow?
238 | User 237,Moderate,Professor,26-35,daily,Moderate,never,blue,Male,Data Analysis,None,Prefer not to answer
239 | User 238,Moderate,Professor,26-35,daily,Moderate,never,blue,Male,Data Analysis,None,~50 MPH
240 | User 239,Moderate,Graduate Student,26-35,daily,Moderate,never,blue,Male,Data Analysis,None,I don't know!
241 | User 240,Advanced,Industry/Professional,36-45,weekly,Advanced,monthly,blue,Male,Psychometrics,Basic,I don't know!
242 | User 241,Moderate,Industry/Professional,26-35,daily,Moderate,weekly,blue,Male,Statistics,None,I don't know!
243 | User 242,Prefer not to answer,Unemployed,36-45,daily,None,never,orange,Prefer not to answer,Graphical Design,Prefer not to answer,~50 MPH
244 | User 243,Advanced,Industry/Professional,less than 25,daily,Advanced,never,blue,Male,Statistics,Basic,I don't know!
245 | User 244,None,Graduate Student,36-45,weekly,Prefer not to answer,daily,green,Male,Econometrics,Basic,I don't know!
246 | User 245,Basic,Graduate Student,26-35,weekly,Moderate,weekly,pink,Female,Statistics,Basic,I don't know!
247 | User 246,Moderate,Industry/Professional,36-45,weekly,Moderate,never,blue,Male,Data Analysis,None,What do you mean? An African or European swallow?
248 | User 247,Advanced,Industry/Professional,26-35,never,Basic,never,blue,Male,Data Analysis,Basic,I don't know!
249 | User 248,Basic,Graduate Student,Graduate Student,daily,Basic,never,blue,Male,Data Analysis,None,I don't know!
250 | User 249,Moderate,Industry/Professional,26-35,weekly,Basic,monthly,blue,Male,Data Analysis,Advanced,~50 MPH
251 | User 250,Advanced,Industry/Professional,46-55,daily,Moderate,never,red,Male,Data Analysis,Basic,What do you mean? An African or European swallow?
252 | User 251,Advanced,Graduate Student,26-35,monthly,Expert,Prefer not to answer,Prefer not to answer,Male,Prefer not to answer,None,What do you mean? An African or European swallow?
253 | User 252,Advanced,Graduate Student,26-35,monthly,Expert,never,green,Male,Statistics,Basic,What do you mean? An African or European swallow?
254 | User 253,Advanced,Industry/Professional,36-45,daily,Advanced,monthly,blue,Male,Econometrics,Moderate,What do you mean? An African or European swallow?
255 | User 254,Advanced,Graduate Student,26-35,weekly,Advanced,never,blue,Male,Econometrics,Basic,I don't know!
256 | User 255,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer
257 | User 256,,,,,,,,,,,~50 MPH
258 | User 257,Moderate,Industry/Professional,26-35,daily,Moderate,monthly,Prefer not to answer,Male,Prefer not to answer,Basic,~50 MPH
259 | User 258,Moderate,Industry/Professional,26-35,daily,Basic,monthly,blue,Male,Prefer not to answer,Basic,What do you mean? An African or European swallow?
260 | User 259,Advanced,Graduate Student,26-35,weekly,Moderate,never,green,Male,Econometrics,None,I don't know!
261 | User 260,Advanced,Industry/Professional,36-45,daily,Advanced,never,orange,Male,Statistics,None,I don't know!
262 | User 261,Moderate,Industry/Professional,26-35,daily,Moderate,never,green,Male,Statistics,None,I don't know!
263 | User 262,Advanced,Industry/Professional,26-35,daily,Advanced,monthly,green,Male,Statistics,Basic,~50 MPH
264 | User 263,Basic,Prefer not to answer,36-45,weekly,Expert,monthly,green,Female,Prefer not to answer,Prefer not to answer,Prefer not to answer
265 | User 264,Basic,Industry/Professional,46-55,weekly,Moderate,weekly,green,Male,Data Analysis,None,I don't know!
266 | User 265,Basic,Industry/Professional,46-55,weekly,Moderate,weekly,green,Male,Data Analysis,None,I don't know!
267 | User 266,Advanced,Industry/Professional,36-45,daily,Advanced,monthly,blue,Male,Statistics,Moderate,What do you mean? An African or European swallow?
268 | User 267,Advanced,Unemployed,Prefer not to answer,daily,Advanced,monthly,blue,Male,Statistics,Basic,I don't know!
269 | User 268,Moderate,Graduate Student,36-45,daily,Moderate,never,green,Male,Data Analysis,None,I don't know!
270 | User 269,Moderate,Professor,26-35,daily,Moderate,monthly,green,Male,Data Analysis,Basic,I don't know!
271 | User 270,Expert,Industry/Professional,26-35,daily,Advanced,never,blue,Male,Data Analysis,Basic,What do you mean? An African or European swallow?
272 | User 271,Moderate,Graduate Student,26-35,weekly,Moderate,never,orange,Male,Prefer not to answer,Basic,Prefer not to answer
273 | User 272,Advanced,Professor,26-35,daily,Advanced,never,green,Female,Statistics,Advanced,I don't know!
274 | User 273,Moderate,Industry/Professional,36-45,daily,Moderate,never,blue,Male,Data Analysis,Moderate,I don't know!
275 | User 274,Moderate,Prefer not to answer,26-35,weekly,Advanced,never,blue,Male,Statistics,None,I don't know!
276 | User 275,,,,,,,,,,Basic,What do you mean? An African or European swallow?
277 | User 276,Moderate,Prefer not to answer,36-45,daily,Prefer not to answer,never,orange,Male,Prefer not to answer,Basic,What do you mean? An African or European swallow?
278 | User 277,Advanced,Industry/Professional,26-35,weekly,Advanced,never,green,Male,Data Analysis,Basic,I don't know!
279 | User 278,Moderate,Graduate Student,Prefer not to answer,daily,Basic,weekly,green,Female,Econometrics,Moderate,What do you mean? An African or European swallow?
280 | User 279,Expert,Graduate Student,26-35,Prefer not to answer,Expert,Prefer not to answer,blue,Prefer not to answer,Statistics,None,I don't know!
281 | User 280,Basic,Industry/Professional,56 or older,weekly,Moderate,never,orange,Male,Data Analysis,Basic,What do you mean? An African or European swallow?
282 | User 281,Advanced,Professor,26-35,monthly,Expert,monthly,blue,Male,Statistics,Moderate,~50 MPH
283 | User 282,Advanced,Industry/Professional,less than 25,daily,Advanced,monthly,green,Male,Data Analysis,Moderate,What do you mean? An African or European swallow?
284 | User 283,Advanced,Industry/Professional,less than 25,daily,Expert,weekly,Prefer not to answer,Male,Data Analysis,Basic,What do you mean? An African or European swallow?
285 | User 284,Basic,Professor,36-45,weekly,Advanced,monthly,Prefer not to answer,Male,Psychometrics,None,What do you mean? An African or European swallow?
286 | User 285,Basic,Prefer not to answer,46-55,daily,Advanced,never,blue,Male,Data Analysis,Basic,What do you mean? An African or European swallow?
287 | User 286,Basic,Graduate Student,less than 25,never,Moderate,never,pink,Female,Psychometrics,Moderate,Prefer not to answer
288 | User 287,Moderate,Industry/Professional,56 or older,monthly,Advanced,monthly,blue,Male,Prefer not to answer,Basic,What do you mean? An African or European swallow?
289 | User 288,Advanced,Industry/Professional,56 or older,Prefer not to answer,Advanced,Prefer not to answer,blue,Male,Data Analysis,Moderate,What do you mean? An African or European swallow?
290 | User 289,,Undergraduate Student,Undergraduate Student,weekly,weekly,weekly,Prefer not to answer,Prefer not to answer,Statistics,Basic,Basic
291 | User 290,,Undergraduate Student,Undergraduate Student,weekly,weekly,weekly,Prefer not to answer,Prefer not to answer,Statistics,Basic,Basic
292 | User 291,Moderate,Industry/Professional,26-35,weekly,Moderate,monthly,green,Male,Data Analysis,Basic,I don't know!
293 | User 292,Moderate,Professor,56 or older,daily,Advanced,monthly,blue,Male,Statistics,Basic,I don't know!
294 | User 293,Expert,Prefer not to answer,Prefer not to answer,monthly,Advanced,never,Prefer not to answer,Male,Data Analysis,None,~50 MPH
295 | User 294,Expert,Prefer not to answer,Prefer not to answer,monthly,Advanced,never,green,Male,Statistics,Moderate,What do you mean? An African or European swallow?
296 | User 295,Moderate,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer
297 | User 296,Basic,Industry/Professional,46-55,monthly,Moderate,never,blue,Female,Data Analysis,Basic,I don't know!
298 | User 297,None,Industry/Professional,46-55,46-55,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Data Analysis,Data Analysis,Prefer not to answer
299 | User 298,None,Industry/Professional,46-55,46-55,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Data Analysis,None,What do you mean? An African or European swallow?
300 | User 299,Basic,Industry/Professional,26-35,weekly,Moderate,never,blue,Male,Data Analysis,Moderate,What do you mean? An African or European swallow?
301 | User 300,Moderate,Graduate Student,36-45,weekly,Advanced,never,green,Male,Statistics,Basic,I don't know!
302 | User 301,Advanced,Industry/Professional,26-35,weekly,Advanced,never,Prefer not to answer,Male,Statistics,Advanced,Prefer not to answer
303 | User 302,Moderate,Professor,56 or older,daily,Advanced,never,red,Male,Prefer not to answer,None,Prefer not to answer
304 | User 303,Moderate,Industry/Professional,46-55,monthly,Expert,never,blue,Male,Data Analysis,Basic,I don't know!
305 | User 304,None,Graduate Student,less than 25,weekly,Basic,weekly,blue,Male,Statistics,None,I don't know!
306 | User 305,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer
307 | User 306,Moderate,Professor,26-35,weekly,Advanced,never,blue,Male,Data Analysis,Moderate,What do you mean? An African or European swallow?
308 | User 307,Moderate,Industry/Professional,26-35,weekly,Advanced,never,orange,Male,Data Analysis,Moderate,I don't know!
309 | User 308,Moderate,Undergraduate Student,26-35,daily,Moderate,never,red,Male,Data Analysis,Moderate,~50 MPH
310 | User 309,Basic,Graduate Student,Prefer not to answer,,,,,,,,~50 MPH
311 | User 310,Basic,Graduate Student,26-35,never,Basic,daily,blue,Male,Econometrics,Basic,I don't know!
312 | User 311,Advanced,Graduate Student,26-35,weekly,Advanced,never,blue,Male,Statistics,Basic,I don't know!
313 | User 312,Advanced,Industry/Professional,36-45,daily,Expert,never,blue,Male,Statistics,Basic,I don't know!
314 | User 313,Basic,Industry/Professional,36-45,daily,Advanced,never,blue,Male,Data Analysis,None,What do you mean? An African or European swallow?
315 | User 314,Advanced,Prefer not to answer,26-35,daily,Moderate,weekly,blue,Male,Statistics,Moderate,What do you mean? An African or European swallow?
316 | User 315,Basic,Professor,46-55,never,Moderate,never,green,Male,Statistics,Prefer not to answer,Prefer not to answer
317 | User 316,Advanced,Graduate Student,26-35,daily,Advanced,weekly,blue,Male,Econometrics,Moderate,I don't know!
318 | User 317,None,Industry/Professional,36-45,never,Moderate,monthly,orange,Female,Data Analysis,Moderate,What do you mean? An African or European swallow?
319 | User 318,Advanced,Undergraduate Student,less than 25,weekly,Moderate,never,green,Female,Statistics,Basic,What do you mean? An African or European swallow?
320 | User 319,Advanced,Professor,46-55,daily,Moderate,never,Prefer not to answer,Male,Prefer not to answer,None,What do you mean? An African or European swallow?
321 | User 320,Moderate,Industry/Professional,56 or older,weekly,Basic,never,blue,Female,Data Analysis,Basic,What do you mean? An African or European swallow?
322 | User 321,Moderate,Industry/Professional,56 or older,weekly,Basic,never,blue,Male,Data Analysis,Basic,~50 MPH
323 | User 322,Basic,Undergraduate Student,36-45,daily,Basic,never,green,Male,Statistics,None,What do you mean? An African or European swallow?
324 | User 323,Moderate,Professor,36-45,daily,Moderate,Prefer not to answer,blue,Male,Data Analysis,Basic,What do you mean? An African or European swallow?
325 | User 324,Basic,Graduate Student,26-35,daily,Moderate,never,blue,Male,Psychometrics,None,What do you mean? An African or European swallow?
326 | User 325,Basic,Graduate Student,26-35,weekly,Moderate,never,green,Male,Prefer not to answer,Basic,~50 MPH
327 | User 326,Moderate,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer,Prefer not to answer
328 | User 327,Advanced,Graduate Student,26-35,daily,Advanced,daily,green,Male,Psychometrics,Advanced,What do you mean? An African or European swallow?
329 |
--------------------------------------------------------------------------------
/Survey/server.R:
--------------------------------------------------------------------------------
1 | library(shiny)
2 |
3 | # Read the survey questions
4 | Qlist <- read.csv("Qlist.csv")
5 | # Qlist <- Qlist[1,]
6 |
7 | shinyServer(function(input, output) {
8 |
9 | # Create an empty vector to hold survey results
10 | results <<- rep("", nrow(Qlist))
11 | # Name each element of the vector based on the
12 | # second column of the Qlist
13 | names(results) <<- Qlist[,2]
14 |
15 | # Hit counter
16 | output$counter <-
17 | renderText({
18 | if (!file.exists("counter.Rdata")) counter <- 0
19 | if (file.exists("counter.Rdata")) load(file="counter.Rdata")
20 | counter <- counter <<- counter + 1
21 |
22 | save(counter, file="counter.Rdata")
23 | paste0("Hits: ", counter)
24 | })
25 |
26 | # This renderUI function holds the primary actions of the
27 | # survey area.
28 | output$MainAction <- renderUI( {
29 | dynamicUi()
30 | })
31 |
32 | # Dynamic UI is the interface which changes as the survey
33 | # progresses.
34 | dynamicUi <- reactive({
35 | # Initially it shows a welcome message.
36 | if (input$Click.Counter==0)
37 | return(
38 | list(
39 | h5("Welcome to Shiny Survey Tool!"),
40 | h6("by Francis Smart")
41 | )
42 | )
43 |
44 | # Once the next button has been clicked once we see each question
45 | # of the survey.
46 | if (input$Click.Counter>0 & input$Click.Counter<=nrow(Qlist))
47 | return(
48 | list(
49 | h5(textOutput("question")),
50 | radioButtons("survey", "Please Select:",
51 | c("Prefer not to answer", option.list()))
52 | )
53 | )
54 |
55 | # Finally we see results of the survey as well as a
56 | # download button.
57 | if (input$Click.Counter>nrow(Qlist))
58 | return(
59 | list(
60 | h4("View aggregate results"),
61 | tableOutput("surveyresults"),
62 | h4("Thanks for taking the survey!"),
63 | downloadButton('downloadData', 'Download Individual Results'),
64 | br(),
65 | h6("Haven't figured out how to get rid of 'next' button yet")
66 | )
67 | )
68 | })
69 |
70 | # This reactive function is concerned primarily with
71 | # saving the results of the survey for this individual.
72 | output$save.results <- renderText({
73 | # After each click, save the results of the radio buttons.
74 | if ((input$Click.Counter>0)&(input$Click.Counter>!nrow(Qlist)))
75 | try(results[input$Click.Counter] <<- input$survey)
76 | # try is used because there is a brief moment in which
77 | # the if condition is true but input$survey = NULL
78 |
79 | # If the user has clicked through all of the survey questions
80 | # then R saves the results to the survey file.
81 | if (input$Click.Counter==nrow(Qlist)+1) {
82 | if (file.exists("survey.results.Rdata"))
83 | load(file="survey.results.Rdata")
84 | if (!file.exists("survey.results.Rdata"))
85 | presults<-NULL
86 | presults <- presults <<- rbind(presults, results)
87 | rownames(presults) <- rownames(presults) <<-
88 | paste("User", 1:nrow(presults))
89 | save(presults, file="survey.results.Rdata")
90 | }
91 | # Because there has to be a UI object to call this
92 | # function I set up render text that distplays the content
93 | # of this funciton.
94 | ""
95 | })
96 |
97 | # This function renders the table of results from the
98 | # survey.
99 | output$surveyresults <- renderTable({
100 | t(summary(presults))
101 | })
102 |
103 | # This renders the data downloader
104 | output$downloadData <- downloadHandler(
105 | filename = "IndividualData.csv",
106 | content = function(file) {
107 | write.csv(presults, file)
108 | }
109 | )
110 |
111 | # The option list is a reative list of elements that
112 | # updates itself when the click counter is advanced.
113 | option.list <- reactive({
114 | qlist <- Qlist[input$Click.Counter,3:ncol(Qlist)]
115 | # Remove items from the qlist if the option is empty.
116 | # Also, convert the option list to matrix.
117 | as.matrix(qlist[qlist!=""])
118 | })
119 |
120 | # This function show the question number (Q:)
121 | # Followed by the question text.
122 | output$question <- renderText({
123 | paste0(
124 | "Q", input$Click.Counter,":",
125 | Qlist[input$Click.Counter,2]
126 | )
127 | })
128 |
129 | })
130 |
--------------------------------------------------------------------------------
/Survey/ui.R:
--------------------------------------------------------------------------------
1 | library(shiny)
2 |
3 | # Define UI for slider demo application
4 | shinyUI(pageWithSidebar(
5 |
6 | # Application title
7 | headerPanel("Shiny Survey Tool v.01"),
8 |
9 | sidebarPanel(
10 | # This is intentionally an empty object.
11 | h6(textOutput("save.results")),
12 | h5("Created by:"),
13 | tags$a("Econometrics by Simulation",
14 | href="http://www.econometricsbysimulation.com"),
15 | h5("For details on how data is generated:"),
16 | tags$a("Blog Post",
17 | href=paste0("http://www.econometricsbysimulation.com/",
18 | "2013/19/Shiny-Survey-Tool.html")),
19 | h5("Github Repository:"),
20 | tags$a("Survey-Tool",
21 | href=paste0("https://github.com/EconometricsBySimulation/",
22 | "Shiny-Demos/tree/master/Survey")),
23 | # Display the page counter text.
24 | h5(textOutput("counter"))
25 | ),
26 |
27 |
28 | # Show a table summarizing the values entered
29 | mainPanel(
30 | # Main Action is where most everything is happenning in the
31 | # object (where the welcome message, survey, and results appear)
32 | uiOutput("MainAction"),
33 | # This displays the action putton Next.
34 | actionButton("Click.Counter", "Next")
35 | )
36 | ))
37 |
--------------------------------------------------------------------------------