Friday 8 January 2016

HR Analytics - Annual Salary Hike Analysis

#This the Code for a basic Data Display Descriptive Analytics SHINY APP 
SHINY App ui.R
# load required libraries - Data.Table - Salary 
library(shiny)
library(plyr)
library(ggplot2)
library(googleVis)
## 
## Welcome to googleVis version 0.5.10
## 
## Please read the Google API Terms of Use
## before you start using the package:
## https://developers.google.com/terms/
## 
## Note, the plot method of googleVis will by default use
## the standard browser to display its output.
## 
## See the googleVis package vignettes for more details,
## or visit http://github.com/mages/googleVis.
## 
## To suppress this message use:
## suppressPackageStartupMessages(library(googleVis))
library(reshape2)
library("data.table", lib.loc="~/R/win-library/3.1")
## 
## Attaching package: 'data.table'
## 
## The following objects are masked from 'package:reshape2':
## 
##     dcast, melt
shinyUI(pageWithSidebar(
  headerPanel(" HR Analytics - Annual Salary Hike Analysis"),
  
  sidebarPanel(
    helpText(" This is a DEMO / POC Application . Different tabs for Attrition Plots. "),
    
    tags$hr(),
    fileInput('file1', 'Choose CSV File from local drive, adjusting parameters if necessary',
              accept=c('text/csv', 'text/comma-separated-values,text/plain')),
    
 checkboxInput('header', 'Header', TRUE),
    radioButtons('sep', 'Separator',
                 c(Comma=',',
                   Semicolon=';',
                   Tab='\t'),
                 'Comma'),
    radioButtons('quote', 'Quote',
                 c(None='',
                   'Double Quote'='"',
                   'Single Quote'="'"),
                 'Double Quote'),
    
    helpText("Now select the output you'd like to see. You can see a barplot OR A PLOT TYPE - 2 , 3 ETC "),
    actionButton("goButton","PLOT-1"),
    actionButton("wordButton","PLOT-2"),
    actionButton("authButton","PLOT-3"),
    
    tags$head(tags$style(type="text/css",
                         "label.radio { display: inline-block; margin:0 10 0 0;  }",
                         ".radio input[type=\"radio\"] { float: none; }"))
    
    ),
  
  mainPanel(
    tabsetPanel(
      tabPanel(" Raw Data - Attrition ",
               h4(textOutput("caption1")),
               checkboxInput(inputId = "pageable", label = "Pageable"),
               conditionalPanel("input.pageable==true",
                                numericInput(inputId = "pagesize",
                                             label = " # of Employee Records to be displayed / page",value=10,min=1,max=50)),
               
               htmlOutput("raw"),
               value = 1),
      tabPanel(" Plot -1 Attrition",
               h4(textOutput("caption2")),
               plotOutput("density",height="500px"),
               htmlOutput("notes2"),
               value = 2),
      tabPanel("Plot -2 Attrition",
               h4(textOutput("caption3")),
               plotOutput("Plot2", height="500px"),
               verbatimTextOutput("sexDiff"),
               htmlOutput("notes3"),
               value = 3),
      tabPanel("Plot -3 Attrition",
               #h4(textOutput("caption3")),
               plotOutput("Plot3", height="500px"),
               #verbatimTextOutput("sexDiff"),
               #htmlOutput("notes4"),
               value = 4),
      tabPanel("Plot -4 Attrition",
               #h4(textOutput("caption3")),
               plotOutput("Plot4", height="500px"),
               #verbatimTextOutput("sexDiff"),
               #htmlOutput("notes3"),
               value = 5),
      tabPanel("Plot -5 Attrition",
               #h4(textOutput("caption3")),
               plotOutput("Plot5", height="500px"),
               #verbatimTextOutput("sexDiff"),
               #htmlOutput("notes3"),
               value = 6),
      
      
      
      id="tabs1")
    
      )
))
## Warning in validateSelected(selected, choices, inputId): 'selected' must be
## the values instead of names of 'choices' for the input 'sep'
## Warning in validateSelected(selected, choices, inputId): 'selected' must be
## the values instead of names of 'choices' for the input 'quote'

HR Analytics - Annual Salary Hike Analysis

This is a DEMO / POC Application . Different tabs for Attrition Plots.




Now select the output you'd like to see. You can see a barplot OR A PLOT TYPE - 2 , 3 ETC  
# http:/

















No comments:

Post a Comment