-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.Rhistory
512 lines (512 loc) · 16.3 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
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
protests <- read.csv('https://countlove.org/data/data.csv')
read.csv(https://countlove.org/data/data.csv)
read.csv('C:/Users/chloe/OneDrive/data.csv')
read.csv('C:/Users/chloe/OneDrive/data.csv')
read.csv('/Users/chloe/OneDrive/data.csv')
protests
num_protests <- nrow(protests)
nrow(protests)
num_features <- ncol(protests)
ncol(protests)
num_attendees <- protests$Attendees
num_attendees
min_attendees <- min(num_attendees, na.rm = TRUE)
min_attendees
max_attendees <- max(num_attendees, na.rm = TRUE)
max_attendees
mean_attendees <- mean(num_attendees, na.rm = TRUE)
mean_attendees
median_attendees <- median(num_attendees, na.rm = TRUE)
median_attendees
mean_median_diff <- print(mean_attendees - median_attendees)
attendees_distribution <- boxpolot(protests$Attendees)
attendees_distribution <- boxplot(protests$Attendees)
log_attendees_distribution <- boxplot(protests, log = "Attendees")
log_attendees_distribution <- boxplot(protests, log = Attendees)
flight_tickets_sample
flight_tickets_sample
read.csv(C:\Users\chloe\OneDrive\Documents\INFO\final-project-djl1626)
read.csv(C:/Users/chloe/OneDrive/Documents/INFO/final-project-djl1626)
> read.csv('C:/Users/chloe/OneDrive/Documents/INFO/final-project-djl1626')
read.csv('C:/Users/chloe/OneDrive/Documents/INFO/final-project-djl1626')
read.csv('C:/Users/chloe/OneDrive/Documents/INFO/final-project-djl1626')
read.csv('C:/Users/chloe/OneDrive/Documents/INFO/final-project-djl1626')
read.csv('C:/Users/chloe/OneDrive/Documents/INFO/final-project-djl1626/2018_Flight_Tickets_Sample.csv')
read.csv('C:/Users/chloe/OneDrive/Documents/INFO/final-project-djl1626/2018_Flight_Tickets_Sample.csv')
source("~/INFO/final-project-djl1626/Aggregate Table Draft.R")
View(flight_tickets)
source("~/INFO/final-project-djl1626/Aggregate Table Draft.R")
source("~/INFO/final-project-djl1626/Aggregate Table Draft.R")
source("~/INFO/final-project-djl1626/Aggregate Table Draft.R")
source("~/INFO/final-project-djl1626/Aggregate Table Draft.R")
source("~/INFO/final-project-djl1626/Aggregate Table Draft.R")
source("~/INFO/final-project-djl1626/Aggregate Table Draft.R")
source("~/INFO/final-project-djl1626/Aggregate Table Draft.R")
source("~/INFO/final-project-djl1626/Aggregate Table Draft.R")
source("~/INFO/final-project-djl1626/Aggregate Table Draft.R")
source("~/INFO/final-project-djl1626/Aggregate Table Draft.R")
source("~/INFO/final-project-djl1626/Aggregate Table Draft.R")
source("~/INFO/final-project-djl1626/Aggregate Table Draft.R")
source("~/INFO/final-project-djl1626/Aggregate Table Draft.R")
source("~/INFO/final-project-djl1626/Aggregate Table Draft.R")
source("~/INFO/final-project-djl1626/Aggregate Table Draft.R")
read.csv('C:/Users/chloe/OneDrive/Documents/INFO/final-project-djl1626/2018_Flight_Tickets_Sample.csv')
source("~/INFO/final-project-djl1626/Aggregate Table Draft.R")
source("~/INFO/final-project-djl1626/Aggregate Table Draft.R")
print(flight_tickets)
source("~/INFO/final-project-djl1626/Aggregate Table Draft.R")
source("~/INFO/final-project-djl1626/Aggregate Table Draft.R")
source("~/INFO/final-project-djl1626/Aggregate Table Draft.R")
?summarise
source("~/INFO/final-project-djl1626/Aggregate Table Draft.R")
source("~/INFO/final-project-djl1626/Aggregate Table Draft.R")
source("~/INFO 201/lect3.R")
source("~/INFO 201/lect3.R")
source("~/INFO 201/lect3.R")
source("~/INFO 201/lect3.R")
source("~/INFO 201/lect3.R")
source("~/INFO 201/lect3.R")
source("~/INFO 201/lect3.R")
source("~/INFO 201/lect3.R")
source("~/INFO 201/lect3.R")
source("~/INFO 201/lect3.R")
source("~/INFO 201/lect3.R")
source("~/INFO 201/lect3.R")
source("~/INFO 201/lect3.R")
source("~/INFO 201/lect3.R")
source("~/INFO 201/lect4.R")
source("~/INFO 201/lect4.R")
source("~/INFO 201/lect4.R")
source("~/INFO 201/lect4.R")
source("~/INFO 201/lect4.R")
source("~/INFO 201/lect4.R")
source("~/INFO 201/lect4.R")
source("~/INFO 201/lect4.R")
source("~/INFO 201/lect4.R")
source("~/INFO 201/datapractice.R")
data()
?msleep
glimpse(msleep)
?class
?typeof
?class
? %>%
? %>%
die_roll(5)
source("~/INFO 201/datapractice.R")
die_roll(5)
die_roll(4)
die_roll(3)
die_roll(8)
die_roll(2)
die_roll <- function(face){
ran_num <- sample.int(6, 1)
rolls <- 1
while (ran_num != face){
ran_num <- sample.int(6, 1)
rolls <- rolls + 1
}
print(rolls)
}
die_roll(5)
source("C:/Users/chloe/Downloads/lect5.r")
die_roll(5)
bb_shark_while <- function(){
i <- 1
while (i <= 3){
print("Baby Shark, doo doo doo doo doo doo")
i <- i + 1
}
print("Baby Shark!")
}
bb_shark_while()
bb_shark_while <- function(){
i <- 1
while (i <= 3){
print("Baby Shark, doo doo doo doo doo doo")
i <- i + 1
}
print("Baby Shark!")
}
bb_shark_while()
source("~/INFO 201/lect5.r")
source("~/INFO 201/lecture5.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
?str_count
inches_to_cm <- function(inches, centimeters){
inches*2.54
return(ans)
}
cm_tall <- inches_to_cm(inches_tall)
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
cm_tall <- inches_to_cm(inches_tall)
cm_tall <- inches_to_cm(inches_tall)
inches_to_cm <- function(inches_tall){
cm_tall <- inches_tall*2.54
return(ans)
}
# Create a variable `inches_tall` that is your (numeric) height in inches
inches_tall <- 67
# Using your `inches_to_cm` function and your `inches_tall` variable,
# create a variable `cm_tall` that is your height in centimeters
cm_tall <- inches_to_cm(inches_tall)
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
second_string
first_string
second_string
has_more_zs()
source("~/INFO 201/A0.R")
second_string
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
?getClass
remove_digits <- function(vector_of_strings) {
vector_of_strings <- c("INFO 201", "CSE 142")
str_replace_all((vector_of_strings), "[:digit:]", "")
}
remove_digits <- function(vector_of_strings) {
vector_of_strings <- c("INFO 201", "CSE 142") str_replace_all((vector_of_strings), "[:digit:]", "")
+
+ }
remove_digits <- function(vector_of_strings) {
vector_of_strings <- c("INFO 201", "CSE 142")
str_replace_all((vector_of_strings), "[:digit:]", "")
print(vector_of_strings)
}
remove_digits <- function(vector_of_strings) {
vector_of_strings <- c("INFO 201", "CSE 142")
str_replace_all((vector_of_strings), "[:digit:]", "")
}
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
return(vector_of_strings)
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
?gsub
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
remove_digits <- function(vector_of_strings){
x <- "0123456789"
gsub("[0-9]", replacement = "", x = vector_of_strings)
}
# Demonstrate that your approach is successful by passing a vector of courses
# to your function. For example, remove_digits(c("INFO 201", "CSE 142"))
remove_digits(c("INFO 201", "CSE 142"))
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
source("~/INFO 201/A0.R")
?cube
?subset
source("~/INFO 201/A0.R")
top_three
movies
source("~/INFO 201/A0.R")
top_three
source("~/INFO 201/A0.R")
excited <- paste0(movies, " is a great movie!")
excited
movies[-4]
movies
hrs(1)
parks_and_rec(0,1)
parks_and_rec <- function(weeks, hrs){
num_episodes <- floor(weeks * hrs * 60/21)
print(num_episodes)
}
parks_and_rec(1, 1)
parks_and_rec(0, 1)
parks_and_rec <- function(weeks, hrs){
num_episodes <- floor(weeks * hrs * 60/21)
if(weeks < 1){
weeks +1
}
print(num_episodes)
}
parks_and_rec(0,1)
parks_and_rec <- function(weeks, hrs){
num_episodes <- floor(weeks * hrs * 60/21)
if(weeks < 1){
weeks + 1
print(num_episodes)
}
print(num_episodes)
}
parks_and_rec(0, 1)
parks_and_rec <- function(weeks, hrs){
num_episodes <- floor(weeks * hrs * 60/21)
if(weeks == 0){
weeks + 1
print(num_episodes)
}
print(num_episodes)
}
parks_and_rec(0,1)
parks_and_rec <- function(weeks, hrs){
num_episodes <- floor(weeks * hrs * 60/21)
print(num_episodes)
}
parks_and_rec(2,20)
parks_and_rec <- function(weeks, hrs){
num_episodes <- floor(weeks * hrs * 60/21)
print(num_episodes)
if(num_episodes >= 125){
print("You have enough time to finish the whole show!")
}
}
parks_and_rec(3,20)
parks_and_rec <- function(weeks, hrs){
num_episodes <- floor(weeks * hrs * 60/21)
print(num_episodes, " out of 125 episodes")
if(num_episodes >= 125){
print("You have enough time to finish the whole show!")
}
}
parks_and_rec(2,20)
parks_and_rec <- function(weeks, hrs){
num_episodes <- floor(weeks * hrs * 60/21)
print(num_episodes)
if(num_episodes >= 125){
print("You have enough time to finish the whole show!")
}
}
parks_and_rec(2, 20)
parks_and_rec(3,20)
1/3
1%%3
fluidConversion <- function(fluid_oz){
gallon <- floor(fuid_oz/128)
quart <- floor(fluid_oz %% 128/32)
pint <- floor(fluid_oz %% 128/32/16)
gill <- floor(fluid_oz %% 128/32/16/4)
print(paste0(fluid_oz, " fluid ounces is ", gallon, " gallon(s)", quart, " quart(s)", pint, " pint(s), and ", gill, " gill(s)"))
}
fluidConversion(4800)
fluidConversion <- function(fluid_oz){
gallon <- floor(fluid_oz/128)
quart <- floor(fluid_oz %% 128/32)
pint <- floor(fluid_oz %% 128/32/16)
gill <- floor(fluid_oz %% 128/32/16/4)
print(paste0(fluid_oz, " fluid ounces is ", gallon, " gallon(s)", quart, " quart(s)", pint, " pint(s), and ", gill, " gill(s)"))
}
fluidConversion(4800)
fluidConversion <- function(fluid_oz){
gallon <- floor(fluid_oz/128)
quart <- floor(fluid_oz %% 128/32)
pint <- floor(fluid_oz %% 128/32/16)
gill <- floor(fluid_oz %% 128/32/16/4)
print(paste0(fluid_oz, " fluid ounces is ", gallon, " gallon(s) ", quart, " quart(s) ", pint, " pint(s), and ", gill, " gill(s)"))
}
fluidConversion(3900)
fluidConversion(398743)
fluidConversion <- function(fluid_oz){
gallon <- floor(fluid_oz/128)
quart <- floor(fluid_oz == 128/32)
pint <- floor(fluid_oz == 128/32/16)
gill <- floor(fluid_oz == 128/32/16/4)
print(paste0(fluid_oz, " fluid ounces is ", gallon, " gallon(s) ", quart, " quart(s) ", pint, " pint(s), and ", gill, " gill(s)"))
}
fluidConversion(398743)
fluidConversion(398744)
fluidConversion(100)
fluidConversion <- function(fluid_oz){
gallon <- floor(fluid_oz/128)
quart <- floor(fluid_oz %% 128/32)
pint <- floor(fluid_oz %% 128/32/16)
gill <- floor(fluid_oz %% 128/32/16/4)
print(paste0(fluid_oz, " fluid ounces is ", gallon, " gallon(s) ", quart, " quart(s) ", pint, " pint(s), and ", gill, " gill(s)"))
}
fluidConversion(100)
source("~/.active-rstudio-document")
source("~/.active-rstudio-document")
source("~/.active-rstudio-document")
?nycflights13
nycflights13
source("~/INFO 201/nycflights_quiz.R")
source("~/INFO 201/nycflights_quiz.R")
source("~/INFO 201/nycflights_quiz.R")
view(flights)
source("~/INFO 201/nycflights_quiz.R")
source("~/INFO 201/nycflights_quiz.R")
source("~/INFO 201/nycflights_quiz.R")
source("~/INFO 201/nycflights_quiz.R")
?view
source("~/INFO 201/nycflights_quiz.R")
View(flights)
View(flights)
view(flights)
View(flights)
source("~/INFO 201/nycflights_quiz.R")
source("~/INFO 201/lab4.R")
source("~/INFO 201/lab4.R")
source("~/INFO 201/lab4.R")
source("~/INFO 201/lab4.R")
source("~/INFO 201/lab4.R")
source("~/INFO 201/lab4.R")
source("~/INFO 201/a2-covid-trends-cristian-4/analysis.R")
source("~/INFO 201/a2-covid-trends-cristian-4/analysis.R")
source("~/INFO 201/a2-covid-trends-cristian-4/analysis.R")
source("~/INFO 201/a2-covid-trends-cristian-4/analysis.R")
source("~/INFO 201/a2-covid-trends-cristian-4/analysis.R")
rlang::last_error()
source("~/INFO 201/a2-covid-trends-cristian-4/analysis.R")
source("~/INFO 201/a2-covid-trends-cristian-4/analysis.R")
source("~/INFO 201/a2-covid-trends-cristian-4/analysis.R")
source("~/INFO 201/a2-covid-trends-cristian-4/analysis.R")
source("~/INFO 201/a2-covid-trends-cristian-4/analysis.R")
source("~/INFO 201/a2-covid-trends-cristian-4/analysis.R")
View(county_by_day)
View(state_by_day)
source("~/INFO 201/a2-covid-trends-cristian-4/analysis.R")
View(totals_by_day)
source("~/INFO 201/a2-covid-trends-cristian-4/analysis.R")
shiny::runApp('INFO 201/Shiny app.r (lecture 14)')
runApp('INFO 201/Shiny app.r (lecture 14)')
runApp('INFO 201/Shiny app.r (lecture 14)')
?checkbox()
?checkboxInput
?hr()
runApp('INFO 201/Shiny app.r (lecture 14)')
shiny::runApp('INFO 201/Shiny app.r (Lecture 16) - Lecture 15 Copy')
runApp('INFO 201/Shiny app.r (Lecture 16) - Lecture 15 Copy')
runApp('INFO 201/Shiny app.r (Lecture 16) - Lecture 15 Copy')
runApp('INFO 201/Shiny app.r (Lecture 16) - Lecture 15 Copy')
runApp('INFO 201/Shiny app.r (Lecture 16) - Lecture 15 Copy')
runApp('INFO 201/Shiny app.r (Lecture 16) - Lecture 15 Copy')
runApp('INFO 201/Shiny app.r (Lecture 16) - Lecture 15 Copy')
runApp('INFO 201/Shiny app.r (Lecture 16) - Lecture 15 Copy')
runApp('INFO 201/Shiny app.r (Lecture 16) - Lecture 15 Copy')
runApp('INFO 201/Shiny app.r (Lecture 16) - Lecture 15 Copy')
runApp('INFO 201/Shiny app.r (Lecture 16) - Lecture 15 Copy')
runApp('INFO 201/Shiny app.r (Lecture 16) - Lecture 15 Copy')
runApp('INFO 201/Shiny app.r (Lecture 16) - Lecture 15 Copy')
runApp('INFO 201/Shiny app.r (Lecture 16) - Lecture 15 Copy')
runApp('INFO 201/Shiny app.r (Lecture 16) - Lecture 15 Copy')
runApp('INFO 201/Shiny app.r (Lecture 16) - Lecture 15 Copy')
runApp('INFO 201/Shiny app.r (Lecture 16) - Lecture 15 Copy')
runApp('INFO 201/Shiny app.r (Lecture 16) - Lecture 15 Copy')
install.packages("plotly")
source("~/INFO 201/a4-data-applications-cristian-4/A4 Test Script.R")
View(state_by_day)
source("~/INFO 201/a4-data-applications-cristian-4/A4 Test Script.R")
View(data)
source("~/INFO 201/a4-data-applications-cristian-4/A4 Test Script.R")
source("~/INFO 201/a4-data-applications-cristian-4/A4 Test Script.R")
source("~/INFO 201/a4-data-applications-cristian-4/A4 Test Script.R")
source("~/INFO 201/a4-data-applications-cristian-4/A4 Test Script.R")
View(data)
shiny::runApp('INFO 201/final-projects-cristian-4')
runApp('INFO 201/Shiny app.r (practice for final project)')
runApp('INFO 201/final-projects-cristian-4')
runApp('INFO 201/Shiny app.r (practice for final project)')
runApp('INFO 201/final-projects-cristian-4')
shiny::runApp('INFO 201/final-projects-cristian-4')
runApp('INFO 201/final-projects-cristian-4')
shiny::runApp('INFO 201/final-projects-cristian-4')
setwd("~/INFO 201/final-projects-cristian-4")
runApp()
runApp()
runApp()
runApp()
runApp()
runApp()
source("~/INFO 201/final-projects-cristian-4/Grouped Bar Chart.R")
View(all_three_df)