Hao YU
April 29th 2016
This is a simple game - finding different symbol - with manipulable options as follows:
Besides, the symbol panel is sourced from the matrix.R script.
library(shiny)
shinyUI(fluidPage(
titlePanel("Finding Symbol !"),
sidebarLayout(
sidebarPanel(
helpText("Choose arguments for the panel !"),
selectInput("symbol",
label = "Background/Wanted Symbol",
choices = c("9/6", "O/0","M/N", "I/T"),
selected = "9/6"),
sliderInput("row", label = h3("Row"), min = 0, max = 100, value = 50),
sliderInput("column", label = h3("Column"), min = 0, max = 100, value = 50),
numericInput("seed", label = h3("Set Random Seed"), value = 24)
),
mainPanel(
h2("Symbol Panel",align="center"),
tableOutput("panel")
)
)
))
library(shiny)
source("matrix.R")
shinyServer(
function(input, output) {
output$panel<-renderTable({
args <- switch(input$symbol,
"9/6"=list("9","6"),
"O/0"=list("O","0"),
"M/N"=list("M","N"),
"I/T"=list("I",'T'))
args$nr <- input$row[1]
args$nc <- input$column[1]
args$seed <- input$seed
do.call(alzheimer,args)
})
})
However, the sliders of row and column, and symbol panel cannot be diplayed well. So for the full edition, see the shiny work.
<!–html_preserve–>