Import data
## # A tibble: 96,429 × 13
## reported_date_time reported_date_time_utc posted_date city state
## <dttm> <dttm> <dttm> <chr> <chr>
## 1 2022-08-29 02:03:00 2022-08-29 02:03:00 2022-09-09 00:00:00 Pinehur… NC
## 2 2022-08-19 21:51:00 2022-08-19 21:51:00 2022-10-08 00:00:00 Rapid C… MI
## 3 2022-08-13 01:30:00 2022-08-13 01:30:00 2022-09-09 00:00:00 Clevela… OH
## 4 2022-08-06 17:00:00 2022-08-06 17:00:00 2022-09-09 00:00:00 Bloomin… IN
## 5 2022-08-04 03:40:00 2022-08-04 03:40:00 2022-09-09 00:00:00 Irvine CA
## 6 2022-07-22 12:00:00 2022-07-22 12:00:00 2022-09-09 00:00:00 Moore OK
## 7 2022-07-19 12:27:00 2022-07-19 12:27:00 2022-09-09 00:00:00 Short P… VA
## 8 2022-07-14 14:56:00 2022-07-14 14:56:00 2022-09-09 00:00:00 Norwalk CT
## 9 2022-07-13 15:40:00 2022-07-13 15:40:00 2022-09-09 00:00:00 Blayney New …
## 10 2022-07-13 00:10:00 2022-07-13 00:10:00 2022-09-09 00:00:00 Greybull WY
## # ℹ 96,419 more rows
## # ℹ 8 more variables: country_code <chr>, shape <chr>, reported_duration <chr>,
## # duration_seconds <dbl>, summary <chr>, has_images <lgl>, day_part <chr>,
## # Time <dttm>
Apply the following dplyr verbs to your data
Filter rows
## # A tibble: 797 × 13
## reported_date_time reported_date_time_utc posted_date city state
## <dttm> <dttm> <dttm> <chr> <chr>
## 1 2023-04-30 19:01:00 2023-04-30 19:01:00 2023-05-19 00:00:00 Calgary AB
## 2 2023-04-16 15:42:00 2023-04-16 15:42:00 2023-05-19 00:00:00 Toronto ON
## 3 2023-04-15 22:04:00 2023-04-15 22:04:00 2023-05-19 00:00:00 Ottawa ON
## 4 2023-02-13 00:32:00 2023-02-13 00:32:00 2023-03-06 00:00:00 Port Ro… ON
## 5 2023-02-11 20:30:00 2023-02-11 20:30:00 2023-03-06 00:00:00 Barrie ON
## 6 2022-10-09 17:00:00 2022-10-09 17:00:00 2022-12-22 00:00:00 Toronto ON
## 7 2022-10-02 00:15:00 2022-10-02 00:15:00 2022-10-08 00:00:00 Little … ON
## 8 2022-09-30 23:10:00 2022-09-30 23:10:00 2022-10-08 00:00:00 victoria BC
## 9 2022-08-27 06:47:00 2022-08-27 06:47:00 2022-09-09 00:00:00 Toronto ON
## 10 2022-07-28 01:00:00 2022-07-28 01:00:00 2022-09-09 00:00:00 Burnaby BC
## # ℹ 787 more rows
## # ℹ 8 more variables: country_code <chr>, shape <chr>, reported_duration <chr>,
## # duration_seconds <dbl>, summary <chr>, has_images <lgl>, day_part <chr>,
## # Time <dttm>
Arrange rows
## # A tibble: 96,429 × 13
## reported_date_time reported_date_time_utc posted_date city state
## <dttm> <dttm> <dttm> <chr> <chr>
## 1 2022-08-29 02:03:00 2022-08-29 02:03:00 2022-09-09 00:00:00 Pinehur… NC
## 2 2022-08-19 21:51:00 2022-08-19 21:51:00 2022-10-08 00:00:00 Rapid C… MI
## 3 2022-08-13 01:30:00 2022-08-13 01:30:00 2022-09-09 00:00:00 Clevela… OH
## 4 2022-08-06 17:00:00 2022-08-06 17:00:00 2022-09-09 00:00:00 Bloomin… IN
## 5 2022-08-04 03:40:00 2022-08-04 03:40:00 2022-09-09 00:00:00 Irvine CA
## 6 2022-07-22 12:00:00 2022-07-22 12:00:00 2022-09-09 00:00:00 Moore OK
## 7 2022-07-19 12:27:00 2022-07-19 12:27:00 2022-09-09 00:00:00 Short P… VA
## 8 2022-07-14 14:56:00 2022-07-14 14:56:00 2022-09-09 00:00:00 Norwalk CT
## 9 2022-07-13 15:40:00 2022-07-13 15:40:00 2022-09-09 00:00:00 Blayney New …
## 10 2022-07-13 00:10:00 2022-07-13 00:10:00 2022-09-09 00:00:00 Greybull WY
## # ℹ 96,419 more rows
## # ℹ 8 more variables: country_code <chr>, shape <chr>, reported_duration <chr>,
## # duration_seconds <dbl>, summary <chr>, has_images <lgl>, day_part <chr>,
## # Time <dttm>
Select columns
## # A tibble: 96,429 × 2
## shape day_part
## <chr> <chr>
## 1 NA night
## 2 NA nautical dusk
## 3 NA night
## 4 NA afternoon
## 5 NA night
## 6 NA morning
## 7 NA morning
## 8 NA afternoon
## 9 NA NA
## 10 NA astronomical dusk
## # ℹ 96,419 more rows
Add columns
## # A tibble: 96,429 × 14
## reported_date_time reported_date_time_utc posted_date city state
## <dttm> <dttm> <dttm> <chr> <chr>
## 1 2022-08-29 02:03:00 2022-08-29 02:03:00 2022-09-09 00:00:00 Pinehur… NC
## 2 2022-08-19 21:51:00 2022-08-19 21:51:00 2022-10-08 00:00:00 Rapid C… MI
## 3 2022-08-13 01:30:00 2022-08-13 01:30:00 2022-09-09 00:00:00 Clevela… OH
## 4 2022-08-06 17:00:00 2022-08-06 17:00:00 2022-09-09 00:00:00 Bloomin… IN
## 5 2022-08-04 03:40:00 2022-08-04 03:40:00 2022-09-09 00:00:00 Irvine CA
## 6 2022-07-22 12:00:00 2022-07-22 12:00:00 2022-09-09 00:00:00 Moore OK
## 7 2022-07-19 12:27:00 2022-07-19 12:27:00 2022-09-09 00:00:00 Short P… VA
## 8 2022-07-14 14:56:00 2022-07-14 14:56:00 2022-09-09 00:00:00 Norwalk CT
## 9 2022-07-13 15:40:00 2022-07-13 15:40:00 2022-09-09 00:00:00 Blayney New …
## 10 2022-07-13 00:10:00 2022-07-13 00:10:00 2022-09-09 00:00:00 Greybull WY
## # ℹ 96,419 more rows
## # ℹ 9 more variables: country_code <chr>, shape <chr>, reported_duration <chr>,
## # duration_seconds <dbl>, summary <chr>, has_images <lgl>, day_part <chr>,
## # Time <dttm>, state_time <chr>
## # A tibble: 96,429 × 1
## state_time
## <chr>
## 1 NC_night
## 2 MI_nautical dusk
## 3 OH_night
## 4 IN_afternoon
## 5 CA_night
## 6 OK_morning
## 7 VA_morning
## 8 CT_afternoon
## 9 New South Wales_NA
## 10 WY_astronomical dusk
## # ℹ 96,419 more rows
Summarize by groups
## # A tibble: 692 × 3
## # Groups: country_code [152]
## country_code state duration
## <chr> <chr> <dbl>
## 1 AE Abu Dhabi 316.
## 2 AE Dubai 78.7
## 3 AE Sharjah 28870
## 4 AF Kabul 382.
## 5 AL Tirana 112.
## 6 AM Yerevan 285
## 7 AO Luanda 3
## 8 AR Buenos Aires 244.
## 9 AR Buenos Aires F.D. 234.
## 10 AR Cordoba 37.5
## # ℹ 682 more rows