June 3, 2018

Introduction

Here I introduce to you a little fun app which was extended from a model by Dana MacLendon.

The model basically puts your potential girl friend into zones, based on her 2 "variables" from 0 to 10: Hot and Crazy. After obtaining the zone that your girl falls into, you can have futher plan with her.

In the next few slides, I will briefly present my workflow. Usage is intuitive and is guided within the app which can be accessed here: https://nhohung.shinyapps.io/GirlZone/.

I hope you have fun using it. You can have a look at a demonstration of the original model at this video: https://www.youtube.com/watch?v=jokc2Bo2ghw.

ui.R (shortened code to fit page)

The UI include the input panel (Hot and Crazy rating) on the left and results (Zone and map) on the right.

library(shiny)
shinyUI(fluidPage(
 titlePanel("Wife Zone app"),
 sidebarLayout(
   sidebarPanel(
     h3("Rate your girl:"),
     sliderInput("HotLevel", "Hot Level", 1, 10, 5),
     sliderInput("CrazyLevel", "Crazy Level", 1, 10, 5),
     checkboxInput("showLabel", "Show Labels", value = FALSE)),
   mainPanel(
     htmlOutput("textHtml1"),
     h4("Visually, she is the blue marker in the plot below:"),
     plotOutput("plot1"),
     h5("Toggle the \"Show label\" option ."),
     htmlOutput("textHtml2")))))

server.R (simplified display purpose)

First I process the 2 input and find the corresponding zone. Example below show output of Zone = 'Fun' for Crazy=5 and Hot=5.

CrazyLevel <- 5; HotLevel <- 5
text <- ifelse(CrazyLevel < 4,
  ifelse(HotLevel < 8, "Don't rate a dude!", "Sorry, your girl is a transgender!"),
  ifelse(HotLevel < 5, "NO GO!",
    ifelse(CrazyLevel > HotLevel,"Danger.",
      ifelse(HotLevel < 8,"Fun.",
        ifelse(CrazyLevel > 7,"Date.",
          ifelse(CrazyLevel > 5, "Wife.","Unicorn."))))))
print(text)
## [1] "Fun."

server.R (simplified display purpose)

Then I plot the zone map (code not shown but evaluated) and the current girl information (blue point).
I leave the zone name for you to discover in the real app ;)