-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.Rhistory
352 lines (352 loc) · 16.8 KB
/
.Rhistory
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
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
source("~/.active-rstudio-document")
3000/128
3000%%128
source("~/.active-rstudio-document")
source("~/.active-rstudio-document")
source("~/.active-rstudio-document")
source("~/.active-rstudio-document")
source("~/.active-rstudio-document")
source("~/INFO201/a0-foundational-skills-vinliu20/Assignment.r")
source("~/INFO201/a0-foundational-skills-vinliu20/Assignment.r")
source("~/INFO201/a0-foundational-skills-vinliu20/Assignment.r")
source("~/INFO201/a1-foundations-mastery-vinliu20/analysis.R")
source("~/INFO201/a2-covid-trends-vinliu20/analysis.R")
national <- read_csv(file = "https://github.com/nytimes/covid-19-data/blob/master/us.csv")
View(national)
national <- read_csv(file = "https://raw.githubusercontent.com/nytimes/covid-19-data/master/us.csv")
View(national)
states <- read_csv(file = "https://raw.githubusercontent.com/nytimes/covid-19-data/master/us-states.csv")
counties <- read_csv(file = "https://raw.githubusercontent.com/nytimes/covid-19-data/master/us-counties.csv")
obs_national <- nrow(national)
obs_states <- nrow(states)
obs_counties <- nrow(counties)
num_features_national <- ncol(national)
num_features_states <- ncol(states)
num_features_counties <- ncol(counties)
View(national)
total_us_cases <- national %>% select(cases) %>% tail(n=1)
View(total_us_cases)
total_us_cases <- national$cases %>% tail(n=1)
total_us_cases <- national$deaths %>% tail(n=1)
# in the dataset? `total_us_cases`
total_us_cases <- national$cases %>% tail(n=1)
# How many total deaths have there been in the U.S. by the most recent date
# in the dataset? `total_us_deaths`
total_us_deaths <- national$deaths %>% tail(n=1)
View(states)
state_highest_cases <- max(states$cases)
state_highest_cases <- states[state_highest_cases, c("cases", "state")]
View(state_highest_cases)
num_highest_cases <- max(states$cases)
state_highest_cases <- states$cases == num_highest_cases
state_highest_cases <- states[states$cases == num_highest_cases]
state_highest_cases <- states$state[states$cases == num_highest_cases]
state_highest_ratio <- states %>% mutate(deaths_per_cases = states$deaths/states$cases)
View(state_highest_ratio)
state_highest_ratio <- states %>% mutate(deaths_per_cases = states$deaths/states$cases)$deathes_per_cases
state_highest_ratio <- states %>% mutate(deaths_per_cases = states$deaths/states$cases)
state_highest_ratio <- states_highest_ratio$deaths_per_case
state_highest_ratio <- states %>% mutate(deaths_per_cases = states$deaths/states$cases)
state_highest_ratio <- state_highest_ratio$deaths_per_case
state_highest_ratio <- state_highest_ratio$deaths_per_cases
state_highest_ratio <- states %>% mutate(deaths_per_cases = states$deaths/states$cases)
state_highest_ratio <- state_highest_ratio$deaths_per_cases
state_highest_ratio <- states$state[state_highest_ratio$deaths_per_cases]
state_highest_ratio <- states %>% mutate(deaths_per_cases = states$deaths/states$cases)
state_highest_ratio <- states$state[state_highest_ratio$deaths_per_cases]
state_highest_ratio <- states %>% mutate(deaths_per_cases = states$deaths/states$cases) %>% head(n=1)
View(state_highest_ratio)
state_highest_ratio <- states %>% mutate(deaths_per_cases = states$deaths/states$cases) %>% tail(n=1)
View(state_highest_ratio)
state_highest_ratio <- states %>% mutate(deaths_per_cases = states$deaths/states$cases) %>%
arrange(desc(deaths_per_cases))
View(state_highest_ratio)
state_highest_ratio <- states %>% mutate(deaths_per_cases = states$deaths/states$cases) %>%
arrange(desc(deaths_per_cases)) %>% head(n=1)
View(state_highest_ratio)
state_highest_ratio <- states %>% mutate(deaths_per_cases = states$deaths/states$cases) %>%
arrange(desc(deaths_per_cases)) %>% head(n=1)$deaths_per_cases
state_highest_ratio <- states %>% mutate(deaths_per_cases = states$deaths/states$cases) %>%
arrange(desc(deaths_per_cases)) %>% head(n=1) %>% $deaths_per_cases
state_highest_ratio <- states %>% mutate(deaths_per_cases = states$deaths/states$cases) %>%
arrange(desc(deaths_per_cases)) %>% head(n=1)
state_highest_ratio <- state_highest_ratio$deaths_per_cases
state_highest_ratio <- states %>% mutate(deaths_per_cases = states$deaths/states$cases) %>%
arrange(desc(deaths_per_cases)) %>% head(n=1)
state_highest_ratio <- state_highest_ratio$state
state_highest_ratio <- states %>% mutate(deaths_per_cases = deaths/cases) %>%
arrange(desc(deaths_per_cases)) %>% head(n=1)
state_highest_ratio <- state_highest_ratio$state
group <- states %>% group_by(date)
View(group)
recent_date <- as.Date(tail(states$date), n=1)
recent_date <- as.Date(tail(states$date, n=1))
recent_data <- states %>% filter(date == recent_date)
View(recent_data)
recent_date <- as.Date(tail(states$date, n=1))
recent_data <- states %>% filter(date == recent_date) %>% select(cases) %>%
arrange(desc()) %>% head(n=1)
recent_date <- as.Date(tail(states$date, n=1))
recent_data <- states %>% filter(date == recent_date) %>% select(cases) %>%
arrange(desc(cases)) %>% head(n=1)
View(recent_data)
recent_data <- states %>% filter(date == recent_date)
View(recent_data)
recent_data <- states %>% filter(date == recent_date) %>% sort(cases)
recent_date <- as.Date(tail(states$date, n=1))
recent_data <- states %>% filter(date == recent_date) %>% arrange(cases)
View(recent_data)
recent_data <- states %>% filter(date == recent_date) %>% arrange(cases) %>% head(n=1)
View(recent_data)
recent_date <- as.Date(tail(states$date, n=1))
recent_data <- states %>% filter(date == recent_date) %>% arrange(cases)
state_lowest_cases <- recent_data$cases %>% head(n=1)
recent_date <- as.Date(tail(states$date, n=1))
recent_data <- states %>% filter(date == recent_date) %>% arrange(cases)
state_lowest_cases <- recent_data$state %>% head(n=1)
recent_date <- as.Date(tail(states$date, n=1))
state_highest_ratio <- states %>% filter(date == recent_date) %>%
mutate(deaths_per_cases = deaths/cases) %>% arrange(desc(deaths_per_cases))%>%
head(n=1)
state_highest_ratio <- state_highest_ratio$state
state_highest_ratio <- states %>% filter(date == recent_date) %>%
mutate(deaths_per_cases = deaths/cases) %>% arrange(desc(deaths_per_cases))%>%
head(n=1)
View(state_highest_ratio)
View(states)
recent_date <- as.Date(tail(states$date, n=1))
state_highest_ratio <- states %>% filter(date == recent_date) %>%
mutate(deaths_per_cases = deaths/cases) %>% arrange(desc(deaths_per_cases))%>%
head(n=1)
state_highest_ratio <- state_highest_ratio$state
source("~/INFO201/a2-covid-trends-vinliu20/analysis.R")
num_highest_cases <- max(states$cases)
state_highest_cases <- states$state[states$cases == num_highest_cases]
recent_date <- as.Date(tail(states$date, n=1))
state_highest_ratio <- states %>% filter(date == recent_date) %>%
mutate(deaths_per_cases = deaths/cases) %>% arrange(desc(deaths_per_cases))%>%
head(n=1)
state_highest_ratio <- state_highest_ratio$state
recent_data <- states %>% filter(date == recent_date) %>% arrange(cases)
state_lowest_cases <- recent_data$state %>% head(n=1)
highest <- states %>% select(states, cases) %>% arrange(desc(cases))
highest <- states %>% select(state, cases) %>% arrange(desc(cases))
View(highest)
highest <- states %>% select(state, cases) %>% arrange(desc(cases)) %>%
slice_head(n=1)
View(highest)
highest <- states %>% select(state, cases) %>% arrange(desc(cases)) %>%
slice_head(n=1)
state_highest_cases <- highest$state
num_highest_cases <- highest$cases
View(counties)
highest_county <- counties %>% select(county, cases) %>% arrange(desc(cases))%>%
slice_head(n=1)
View(highest_county)
highest_county <- counties %>% select(county, cases) %>% arrange(desc(cases))%>%
slice_head(n=1)
county_highest_cases <- highest_county$county
# What is the highest number of cases that have happened in a single county?
# `num_highest_cases_county`
county_highest_cases <- highest_county$cases
counties <- counties %>% mutate(location = str_c(county + ", " + state))
counties <- counties %>% mutate(location = str_c(county, ", ", state))
View(counties)
counties <- counties %>% mutate(location = county + ", " +state)
counties <- counties %>% mutate(location = str_c(county, ", ", state))
View(highest)
View(counties)
source("~/INFO201/a2-covid-trends-vinliu20/analysis.R")
View(highest_county)
location_most_deaths <- counties %>% select(location, cases) %>%
arrange(desc(cases))
View(location_most_deaths)
location_most_deaths <- (counties %>% select(location, cases) %>%
arrange(desc(cases)))$location
location_most_deaths <- (counties %>% select(location, cases) %>%
arrange(desc(cases)) %>% slice_head(n=1))$location
View(national)
national <- national %>% mutate(new_cases = lag(cases))
View(national)
national <- national %>% mutate(new_cases = lag(cases, 2))
View(national)
national <- national %>% mutate(new_cases = lag(cases, diff(cases)))
diff_cases <- diff(cases)
diff_cases <- diff(national$cases)
View(national)
national <- national %>% mutate(new_cases = lag(cases, 2, diff(cases)))
national <- national %>% mutate(new_cases = lag(cases, 2)
national <- national %>% mutate(new_cases = lag(cases, 2
national <- national %>% mutate(new_cases = diff(national$cases )
national <- national %>% mutate(new_cases = diff(national$cases ))
national <- national %>% mutate(new_cases = diff(national$cases))
national <- national %>% mutate(new_cases = lag(diff(national$cases),1))
state_highest_ratio <- mutate(deaths_per_cases = deaths/cases) %>%
arrange(desc(deaths_per_cases))%>% head(n=1) %>% pull(state)
state_highest_ratio <- state %>% mutate(deaths_per_cases = deaths/cases) %>%
arrange(desc(deaths_per_cases))%>% head(n=1) %>% pull(state)
source("~/INFO201/a2-covid-trends-vinliu20/analysis.R")
state_highest_ratio <- states %>% mutate(deaths_per_cases = deaths/cases) %>%
arrange(desc(deaths_per_cases))%>% head(n=1) %>% pull(state)
# Which state has had the lowest number of cases *as of the most recent date*?
# (hint, this is a little trickier to calculate than the maximum because
# of the meaning of the row). `state_lowest_cases`
#recent_data <- states %>% filter(date == recent_date) %>% arrange(cases)
state_lowest_cases <- states$state %>% head(n=1)
state_lowest_cases <- states %>% min(cases)
state_lowest_cases <- states %>% filter(cases==min(states$cases)) %>% pull(state)
View(states)
recent_date <- as.Date(tail(states$date, n=1))
recent_data <- states %>% filter(date == recent_date) %>% arrange(cases)
state_lowest_cases <- recent_data$state %>% head(n=1)
source("~/INFO201/a2-covid-trends-vinliu20/analysis.R")
grouped_states <- counties %>% group_by(state)
View(grouped_states)
recent_data_county <- counties %>% filter(date == recent_date)
highest_county <- counties %>% select(county, cases) %>% filter(cases == max(cases))
county_highest_cases <- highest_county$county
View(recent_data_county)
debugSource("~/INFO201/a2-covid-trends-vinliu20/analysis.R")
debugSource("~/INFO201/a2-covid-trends-vinliu20/analysis.R")
View(recent_data_county)
recent_data_county <- counties %>% filter(date == recent_date) %>% group_by(state)
View(recent_data)
View(recent_data_county)
recent_data_county <- counties %>% filter(date == recent_date) %>%
group_by(state) %>% summarise(max_vec = max(cases))
View(recent_data_county)
recent_data_county <- counties %>% filter(date == recent_date) %>%
group_by(location) %>% summarise(max_vec = max(cases))
View(recent_data_county)
num_location <- unique(counties$location)
recent_data_county <- counties %>% filter(date == recent_date) %>%
group_by(state) %>% summarise(max_vec = max(cases))
View(recent_data_county)
recent_data_county <- counties %>% filter(date == recent_date) %>%
group_by(state, location) %>% summarise(max_vec = max(cases))
View(recent_data_county)
recent_data_county <- counties %>% filter(date == recent_date) %>%
group_by(state, location) %>% summarise(most_cases = max(cases))
View(recent_data_county)
recent_data_county <- counties %>% filter(date == recent_date) %>%
group_by(state) %>% summarise(most_cases = max(cases)) %>% pull(location)
recent_data_county <- counties %>% filter(date == recent_date) %>%
group_by(state) %>% summarise(most_cases = max(cases))
View(recent_data_county)
recent_data_county <- counties %>% filter(date == recent_date) %>%
group_by(state, location) %>% summarise(most_cases = max(cases))
View(recent_data_county)
recent_data_county <- counties %>% filter(date == recent_date) %>%
group_by(state, location) %>% summarise(most_cases = max(cases)) %>%
pull(location)
recent_data_county <- counties %>% filter(date == recent_date) %>%
group_by(state, location) %>% pull(location) %>% summarise(most_cases = max(cases))
num_location <- unique(counties$location)
num_location <- unique(recent_data_county)
recent_data_county <- counties %>% filter(date == recent_date)
num_location <- unique(recent_data_county$location)
debugSource("~/INFO201/a2-covid-trends-vinliu20/analysis.R")
recent_data_county <- counties %>% filter(date == recent_date) %>%
group_by(state) %>% summarise(most_cases = max(cases))
View(recent_data_county)
highest_in_each_state <- counties$location[recent_data_county]
recent_data_county <- counties %>% filter(date == recent_date) %>%
group_by(state) %>% summarise(most_cases = max(cases)) %>% pull(cases)
recent_data_county <- counties %>% filter(date == recent_date) %>%
group_by(state) %>% summarise(most_cases = max(cases)) %>% pull(most_cases)
highest_in_each_state <- counties$location[recent_data_county]
highest_in_each_state <- counties$location[recent_data_county]
view(highest_in_each_state)
View(counties)
highest_in_each_state <- counties %>% filter(cases == recent_data_county)
recent_data_county <- counties %>% filter(date == recent_date) %>%
group_by(location, state) %>% summarise(most_cases = max(cases)) %>% pull(most_cases)
recent_data_county <- counties %>% filter(date == recent_date) %>%
group_by(location, state) %>% summarise(most_cases = max(cases))
View(recent_data_county)
recent_data_county <- counties %>% filter(date == recent_date) %>%
group_by(state) %>% summarise(most_cases = max(cases)) %>% pull(most_cases)
recent_data_county <- counties %>% filter(date == recent_date) %>%
group_by(state) %>% summarise(most_cases = max(cases))
View(recent_data_county)
debugSource("~/INFO201/a2-covid-trends-vinliu20/analysis.R")
source("~/INFO201/a3-data-visualization-vinliu20/analysis.R")
View(spokane_data)
setwd("~/INFO201/final-projects-sjhu2020")
shiny::runApp()
runApp()
runApp()
runApp()
runApp()
runApp()
runApp()
runApp()
runApp()
runApp()
install.packages("shinyBS")
runApp()
runApp()
runApp()
shiny::runApp()
runApp()
source("~/GitHub/final-projects-sjhu2020/chart_4.r")
source("~/GitHub/final-projects-sjhu2020/chart_4.r")
source("~/GitHub/final-projects-sjhu2020/chart_4.r")
source("~/GitHub/final-projects-sjhu2020/chart_4.r")
View(games_df)
source("~/GitHub/final-projects-sjhu2020/chart_4.r")
source("~/GitHub/final-projects-sjhu2020/chart_4.r")
source("~/GitHub/final-projects-sjhu2020/chart_4.r")
source("~/GitHub/final-projects-sjhu2020/chart_4.r")
source("~/GitHub/final-projects-sjhu2020/chart_4.r")
source("~/GitHub/final-projects-sjhu2020/chart_4.r")
source("~/GitHub/final-projects-sjhu2020/chart_4.r")
View(genres_df)
View(genres_df)
source("~/GitHub/final-projects-sjhu2020/chart_4.r")
View(genres_df)
source("~/GitHub/final-projects-sjhu2020/chart_4.r")
source("~/GitHub/final-projects-sjhu2020/chart_4.r")
View(genres_grouped_df)
View(genres_grouped_freq_df)
source("~/GitHub/final-projects-sjhu2020/chart_4.r")
View(genres_grouped_freq_df)
source("~/GitHub/final-projects-sjhu2020/chart_4.r")
source("~/GitHub/final-projects-sjhu2020/chart_4.r")
source("~/GitHub/final-projects-sjhu2020/chart_4.r")
source("~/GitHub/final-projects-sjhu2020/chart_4.r")
source("~/GitHub/final-projects-sjhu2020/chart_4.r")
source("~/GitHub/final-projects-sjhu2020/chart_4.r")
source("~/GitHub/final-projects-sjhu2020/chart_4.r")
source("~/GitHub/final-projects-sjhu2020/chart_4.r")
source("~/GitHub/final-projects-sjhu2020/chart_4.r")
source("~/GitHub/final-projects-sjhu2020/chart_4.r")
source("~/GitHub/final-projects-sjhu2020/chart_4.r")
source("~/GitHub/final-projects-sjhu2020/chart_4.r")
runApp()
install.packages('rsconnect')
install.packages("rsconnect")
rsconnect::setAccountInfo(name='sjhu2020', token='E636DA63D0B1D9E68EF78317E947F486', secret='vRXDxn4zgnGR+/Y9k+5bd4jiKPjTCTUzOnb9VDUa')
library(rsconnect)
rsconnect::deployApp('app.r')
library(rsconnect)
rsconnect::deployApp()
shiny::runApp()
source("~/GitHub/final-projects-sjhu2020/chart_4.r")
source("~/GitHub/final-projects-sjhu2020/chart_4.r")
source("~/GitHub/final-projects-sjhu2020/chart_4.r")
2
source("~/GitHub/final-projects-sjhu2020/chart_4.r")
source("~/GitHub/final-projects-sjhu2020/chart_4.r")
source("~/GitHub/final-projects-sjhu2020/chart_4.r")
source("~/GitHub/final-projects-sjhu2020/chart_4.r")
source("~/GitHub/final-projects-sjhu2020/chart_4.r")
View(games_df)
source("~/GitHub/final-projects-sjhu2020/chart_4.r")
runApp()
runApp()
runApp()
runApp()
runApp()
runApp()
We will analyze video game using datasets from Kaggle on video game sales and popularity. We will use google trends to analyze which video games and genres were the most popular during the Covid-19 pandemic. Our findings will be displayed in charts that reflect the data over the last few years.