forked from celevitz/topChef
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdatasets.R
More file actions
302 lines (287 loc) · 10.6 KB
/
datasets.R
File metadata and controls
302 lines (287 loc) · 10.6 KB
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
#' chefdetails
#'
#' A dataset containing information on each Chef for each season. As of now,
#' it has data for all Top Chef US seasons, Top Chef Masters (US), and one
#' season of Top Chef Canada.
#'
#' @docType data
#'
#' @usage data(chefdetails)
#'
#' @format This data frame contains the following columns:
#' \describe{
#' \item{\code{name}}{Chef name (full name)}
#' \item{\code{chef}}{Shorter version of the chef's name}
#' \item{\code{hometown}}{Chef's hometown, if known}
#' \item{\code{city}}{City in which the Chef lived at the time of show}
#' \item{\code{state}}{State in which the Chef lived at the time of the show}
#' \item{\code{age}}{Age of Chef at the time of the show}
#' \item{\code{szn}}{Name of season}
#' \item{\code{sznnumber}}{Season number}
#' \item{\code{series}}{Top Chef US (listed as US); Top Chef US Masters
#' (listed as US Masters); Top Chef Canada (listed
#' as Canada)}
#' \item{\code{placement}}{Final result of the Chef.}
#' \item{\code{poc}}{Flag for whether the Chef is a person of color. Will be
#' blank if they are not}
#' \item{\code{occupation}}{Occupation of Chef at time of show, if known}
#' \item{\code{gender}}{Gender of Chef}
#' }
#'
#' @importFrom dplyr select
#' @importFrom dplyr mutate
#' @importFrom dplyr group_by
#' @importFrom dplyr arrange
#' @importFrom dplyr summarise
#' @importFrom tidyr pivot_wider
#' @importFrom tidyr pivot_longer
#'
#' @source \url{https://en.wikipedia.org/wiki/Top_Chef}
#' @examples
#' library(dplyr)
#' library(tidyr)
#' chefdetails %>%
#' filter(szn == "World All Stars")
"chefdetails"
#' challengedescriptions
#'
#' A dataset containing information about each challenge that the
#' Chefs compete in
#'
#' @docType data
#'
#' @usage data(challengedescriptions)
#'
#' @format This data frame contains the following columns:
#' \describe{
#' \item{\code{szn}}{Name of season}
#' \item{\code{sznnumber}}{Season number}
#' \item{\code{series}}{Top Chef US (listed as US); Top Chef US Masters
#' (listed as US Masters); Top Chef Canada (listed as Canada)}
#' \item{\code{episode}}{Episode number}
#' \item{\code{challenge_type}}{Challenge type: qualifying challenge,
#' elimination, quickfire, sudden death quickfire, quickfire
#' elimination, battle of the sous chefs}
#' \item{\code{outcome_type}}{Is the challenge run as a team or as an
#' individual?}
#' \item{\code{challenge.description}}{Description of the challenge}
#' \item{\code{shop.time}}{If they go shopping, how long do they have?
#' Unit is minutes}
#' \item{\code{shop.budget}}{If they go shopping, what is their budget?
#' Unit is dollars unless otherwise specified.}
#' \item{\code{prep_time}}{If they have prep time, how long do they have?
#' Unit is minutes}
#' \item{\code{cook_time}}{How long they have to cook (in minutes)}
#' \item{\code{product.placement}}{List of products promoted in the
#' challenge, other than the usual series-wide product placement.
#' Will be blank if none were mentioned}
#' \item{\code{advantage}}{If an advantage is offered to the winner of the
#' challenge, it will be listed here: e.g., Immunity, choosing
#' a protein in the elimination challenge, choosing your team in
#' the elimination challenge. Will be blank if none were mentioned.}
#' \item{\code{Last.Chance.Kitchen.winner.enters}}{If someone comes in from
#' Last Chance Kitchen at this challenge, their name will be listed here.
#' Will be blank for all other challenges.}
#' \item{\code{Restaurant.War.winner}}{Role played by the winner of
#' restaurant wars: Executive Chef, Front of House, the full team,
#' Line Cook, Roles Rotated, or No one won. Will only have values
#' for Restaurant War episodes.}
#' \item{\code{Restaurant.War.eliminated}}{Role played by the Chef eliminated
#' after restaurant wars: Executive Chef, Front of House, the full
#' team, Line Cook, Roles Rotated. Will only have values for
#' Restaurant War episodes.}
#' \item{\code{Did.judges.visit.winning.team.first}}{Categorical variable of
#' which team was shown serving the judges first. Will only have values for
#' Restaurant Wars episodes.}
#' }
#'
#' @importFrom dplyr select
#' @importFrom dplyr mutate
#' @importFrom dplyr group_by
#' @importFrom dplyr arrange
#' @importFrom dplyr summarise
#' @importFrom tidyr pivot_wider
#' @importFrom tidyr pivot_longer
#'
#' @source \url{https://en.wikipedia.org/wiki/Top_Chef}
#' @examples
#' library(dplyr)
#' library(tidyr)
#' challengedescriptions %>%
#' group_by(series,szn,outcome_type) %>%
#' summarise(n=n()) %>%
#' pivot_wider(names_from=outcome_type,values_from=n)
"challengedescriptions"
#' challengewins
#'
#' A dataset containing win and loss data for each chef in each episode
#'
#' @docType data
#'
#' @usage data(challengewins)
#'
#' @format This data frame contains the following columns:
#' \describe{
#' \item{\code{szn}}{Name of season}
#' \item{\code{sznnumber}}{Season number}
#' \item{\code{series}}{Top Chef US (listed as US); Top Chef US Masters
#' (listed as US Masters); Top Chef Canada (listed
#' as Canada)}
#' \item{\code{episode}}{Episode number}
#' \item{\code{in.competition}}{True / false for whether the Chef was still
#' in the competition at the time of the
#' challenge}
#' \item{\code{chef}}{Name of chef}
#' \item{\code{challenge_type}}{Challenge type: qualifying challenge,
#' elimination, quickfire, sudden death quickfire,
#' quickfire elimination, battle of the sous
#' chefs}
#' \item{\code{outcome}}{Result for each Chef in the competition for that
#' challenge}
#' \item{\code{rating}}{Numeric rating provided to chefs in Top Chef US
#' Masters Seasons 1 and 2. Will be blank for all
#' other seasons.}
#' }
#'
#' @importFrom dplyr select
#' @importFrom dplyr mutate
#' @importFrom dplyr group_by
#' @importFrom dplyr arrange
#' @importFrom dplyr summarise
#' @importFrom tidyr pivot_wider
#' @importFrom tidyr pivot_longer
#'
#' @source \url{https://en.wikipedia.org/wiki/Top_Chef}
#' @examples
#' library(dplyr)
#' library(tidyr)
#' challengewins %>%
#' group_by(outcome) %>%
#' summarise(n=n())
"challengewins"
#' episodeinfo
#'
#' A dataset containing information about each episode
#'
#' @docType data
#'
#' @usage data(episodeinfo)
#'
#' @format This data frame contains the following columns:
#' \describe{
#' \item{\code{szn}}{Name of season}
#' \item{\code{sznnumber}}{Season number}
#' \item{\code{series}}{Top Chef US (listed as US); Top Chef US Masters
#' (listed as US Masters); Top Chef Canada (listed as
#' Canada)}
#' \item{\code{overall.episode.number}}{Running number of episode within
#' the series}
#' \item{\code{episode}}{Episode number}
#' \item{\code{episode_name}}{Name of episode}
#' \item{\code{air_date}}{Date the episode originally aired}
#' \item{\code{#.of.competitors}}{Number of Chefs still in the competition}
#' }
#'
#' @importFrom dplyr select
#' @importFrom dplyr mutate
#' @importFrom dplyr group_by
#' @importFrom dplyr arrange
#' @importFrom dplyr summarise
#' @importFrom tidyr pivot_wider
#' @importFrom tidyr pivot_longer
#'
#' @source \url{https://en.wikipedia.org/wiki/Top_Chef}
#' @examples
#' library(dplyr)
#' library(tidyr)
#' episodeinfo %>% filter(szn=="World All Stars")
"episodeinfo"
#' judges
#'
#' A dataset containing information about who were the guest judges for
#' each challenge
#'
#' @docType data
#'
#' @usage data(judges)
#'
#' @format This data frame contains the following columns:
#' \describe{
#' \item{\code{szn}}{Name of season}
#' \item{\code{sznnumber}}{Season number}
#' \item{\code{series}}{Top Chef US (listed as US); Top Chef US Masters
#' (listed as US Masters); Top Chef Canada (listed as Canada)}
#' \item{\code{episode}}{Episode number}
#' \item{\code{challenge_type}}{Challenge type: qualifying challenge,
#' elimination, quickfire, sudden death quickfire, quickfire
#' elimination, battle of the sous chefs}
#' \item{\code{outcome_type}}{Is the challenge run as a team or as an
#' individual?}
#' \item{\code{guestjudge}}{Name of guest judge}
#' \item{\code{competed_on_TC}}{Will have a value of Yes if they competed
#' on a season of Top Chef}
#' \item{\code{other_shows}}{Information about other shows that this
#' individual has appeared on}
#' }
#'
#' @importFrom dplyr select
#' @importFrom dplyr mutate
#' @importFrom dplyr group_by
#' @importFrom dplyr arrange
#' @importFrom dplyr summarise
#' @importFrom tidyr pivot_wider
#' @importFrom tidyr pivot_longer
#'
#' @source \url{https://en.wikipedia.org/wiki/Top_Chef}
#' @examples
#' library(dplyr)
#' library(tidyr)
#' judges %>%
#' filter(guestjudge == "Eric Ripert") %>%
#' group_by(challenge_type) %>%
#' summarise(n=n())
"judges"
#' rewards
#'
#' A dataset containing information about rewards and prizes won by challenge
#'
#' @docType data
#'
#' @usage data(rewards)
#'
#' @format This data frame contains the following columns:
#' \describe{
#' \item{\code{szn}}{Name of season}
#' \item{\code{sznnumber}}{Season number}
#' \item{\code{series}}{Top Chef US (listed as US); Top Chef US Masters
#' (listed as US Masters); Top Chef Canada (listed as Canada)}
#' \item{\code{episode}}{Episode number}
#' \item{\code{challenge_type}}{Challenge type: qualifying challenge,
#' elimination, quickfire, sudden death quickfire, quickfire elimination,
#' battle of the sous chefs}
#' \item{\code{outcome_type}}{Is the challenge run as a team or as an
#' individual?}
#' \item{\code{reward_type}}{Variable describing whether the reward is
#' money or a prize}
#' \item{\code{reward}}{Description of the full reward}
#' \item{\code{chef}}{Name of chef}
#' }
#'
#' @importFrom dplyr select
#' @importFrom dplyr mutate
#' @importFrom dplyr group_by
#' @importFrom dplyr arrange
#' @importFrom dplyr summarise
#' @importFrom tidyr pivot_wider
#' @importFrom tidyr pivot_longer
#'
#' @source \url{https://en.wikipedia.org/wiki/Top_Chef}
#' @examples
#' library(dplyr)
#' library(tidyr)
#' rewards %>%
#' filter(reward_type == "Money") %>%
#' mutate(reward=as.numeric(reward)) %>%
#' group_by(szn) %>%
#' summarise(total=sum(reward))
"rewards"