-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathui.R
113 lines (99 loc) · 3.8 KB
/
ui.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# Student name: Xue Chen
# Student ID: 30100763
# Last modified: 10 June, 2019
library(shiny)
library(tm)
library(SnowballC)
library(RColorBrewer)
library(wordcloud)
library(markdown)
library(memoise)
library(leaflet)
library(dplyr)
library(plotly)
table <- read.csv('employee.csv')
loc <- read.csv('usemployee.csv')
distemp <- data.frame(
name = c("Amazon", "Apple", "Facebook", "Google", "Microsoft", "Netflix"),
employees = c(24247, 10476, 1239, 6345, 12553, 462)
)
rate <- data.frame(
CompanyName = c("Amazon", "Apple", "Facebook", "Google", "Microsoft", "Netflix"),
OverallRating = c(6,3,1,2,4,5),
CompBenefits = c(6,4,1,2,5,3),
WorkLifeBalance = c(6,5,2,1,3,4),
CareerOppotunities = c(4,5,1,2,3,6),
Rankof6 = c(6,4,1,2,3,5)
)
companynames <- list("Amazon" = 'az',
"Apple" = 'ap',
"Facebook" = 'fb',
"Google" = 'go',
"Microsoft" = 'ms',
"Netflix" = 'nf')
Amazon <- table %>% filter(Company == "Amazon")
Apple <- table %>% filter(Company == "Apple")
Facebook <- table %>% filter(Company == "Facebook")
Google <- table %>% filter(Company == "Google")
Microsoft <- table %>% filter(Company == "Microsoft")
Netflix <- table %>% filter(Company == "Netflix")
Amazonloc <- loc %>% filter(Company == "Amazon")
Appleloc <- loc %>% filter(Company == "Apple")
Facebookloc <- loc %>% filter(Company == "Facebook")
Googleloc <- loc %>% filter(Company == "Google")
Microsoftloc <- loc %>% filter(Company == "Microsoft")
Netflixloc <- loc %>% filter(Company == "Netflix")
shinyUI(navbarPage("FAANG and Microsoft Employee Reviews",
tabPanel("Distribution",
sidebarLayout(
sidebarPanel(
checkboxGroupInput("names", "Company Names:",
choices = distemp$name,
selected = distemp$name)
),
mainPanel(
plotlyOutput("pieplot")
)
)
),
tabPanel("Map",
sidebarLayout(
sidebarPanel(
radioButtons("mapname", "Choose a company:",
choices = companynames, selected = 'az')),
mainPanel(
leafletOutput("mymap")
)
)),
tabPanel("Ranking",
sidebarLayout(
sidebarPanel(
checkboxGroupInput("show_vars", "Catagories:",
names(rate), selected = (names(rate)))
),
mainPanel(
tabPanel("rate", DT::dataTableOutput("mytable1"))
)
)
),
tabPanel("Pros&Cons",
sidebarLayout(
sidebarPanel(
selectInput("selection", "Choose a company:",
choices = companynames, selected = "Amazon"),
radioButtons("procon", label = h5(""),
choices = list("Pros" = 1, "Cons" = 2),
selected = 1),
hr(),
sliderInput("max",
"Maximum Number of Words:",
min = 1, max = 50, value = 20)
),
# Show Word Cloud
mainPanel(
plotOutput("woldcloudplot")
)
)
)
)
)