This report will help you use all of the skills you’ve been introduced to during this R workshop including:
Before trying to knit this document, you need the Fulton County Shapefiles. Here are the steps:
FultonCountyZipCodes.zip
compressed fileFultonCountyZipCodes
.
C:\Rworkshop
so the sub-folder is C:\Rworkshop\FultonCountyZipCodes
The dataset you will be working with has 82101 COVID cases from mostly the Fulton County, GA area. These data cover COVID cases reported from December 2019 to July 2021.
Overall (N=82101) | |
---|---|
case_age | |
   N-Miss | 48 |
   Mean (SD) | 39.685 (19.159) |
   Range | -20.000 - 106.000 |
case_gender | |
   N-Miss | 63 |
   Female | 43299 (52.8%) |
   Male | 38393 (46.8%) |
   Unknown | 346 (0.4%) |
case_race | |
   N-Miss | 2630 |
   AMERICAN INDIAN/ALASKA NATIVE | 84 (0.1%) |
   ASIAN | 3075 (3.9%) |
   BLACK | 35048 (44.1%) |
   NATIVE HAWAIIAN/PACIFIC ISLANDER | 79 (0.1%) |
   OTHER | 5863 (7.4%) |
   UNKNOWN | 3723 (4.7%) |
   WHITE | 31599 (39.8%) |
case_eth | |
   N-Miss | 2574 |
   HISPANIC/LATINO | 8625 (10.8%) |
   NON-HISPANIC/LATINO | 62677 (78.8%) |
   NOT SPECIFIED | 8225 (10.3%) |
Overall (N=82101) | |
---|---|
sym_fever | |
   N-Miss | 31577 |
   No | 33951 (67.2%) |
   Unk | 1446 (2.9%) |
   Yes | 15127 (29.9%) |
sym_subjfever | |
   N-Miss | 37908 |
   No | 30457 (68.9%) |
   Unk | 1024 (2.3%) |
   Yes | 12712 (28.8%) |
sym_myalgia | |
   N-Miss | 32137 |
   No | 29210 (58.5%) |
   Unk | 1220 (2.4%) |
   Yes | 19533 (39.1%) |
   YES | 1 (0.0%) |
sym_losstastesmell | |
   N-Miss | 50724 |
   No | 18109 (57.7%) |
   Unk | 534 (1.7%) |
   Yes | 12734 (40.6%) |
sym_sorethroat | |
   N-Miss | 32241 |
   No | 36106 (72.4%) |
   Unk | 1238 (2.5%) |
   Yes | 12516 (25.1%) |
sym_cough | |
   N-Miss | 31630 |
   No | 27474 (54.4%) |
   Unk | 1054 (2.1%) |
   Yes | 21943 (43.5%) |
sym_headache | |
   N-Miss | 32018 |
   No | 27196 (54.3%) |
   Unk | 1212 (2.4%) |
   Yes | 21675 (43.3%) |
sym_resolved | |
   N-Miss | 42294 |
   No, still symptomatic | 14466 (36.3%) |
   Unknown symptom status | 2076 (5.2%) |
   Yes, date specified below | 15304 (38.4%) |
   Yes, date unknown | 7961 (20.0%) |
Overall (N=82101) | |
---|---|
sym_fever.c | |
   No, unk, na | 66974 (81.6%) |
   Yes | 15127 (18.4%) |
sym_sorethroat.c | |
   No, unk, na | 69585 (84.8%) |
   Yes | 12516 (15.2%) |
sym_cough.c | |
   No, unk, na | 60158 (73.3%) |
   Yes | 21943 (26.7%) |
sym_headache.c | |
   No, unk, na | 60426 (73.6%) |
   Yes | 21675 (26.4%) |
Let’s also add some nicer labels and then make the table of these recoded symptoms by race.
Black (N=35048) | Other, unknown or missing (N=15454) | White (N=31599) | Total (N=82101) | |
---|---|---|---|---|
Fever | ||||
   No, unk, na | 28725 (82.0%) | 13017 (84.2%) | 25232 (79.9%) | 66974 (81.6%) |
   Yes | 6323 (18.0%) | 2437 (15.8%) | 6367 (20.1%) | 15127 (18.4%) |
Sore Throat | ||||
   No, unk, na | 30356 (86.6%) | 13393 (86.7%) | 25836 (81.8%) | 69585 (84.8%) |
   Yes | 4692 (13.4%) | 2061 (13.3%) | 5763 (18.2%) | 12516 (15.2%) |
Cough | ||||
   No, unk, na | 25000 (71.3%) | 12471 (80.7%) | 22687 (71.8%) | 60158 (73.3%) |
   Yes | 10048 (28.7%) | 2983 (19.3%) | 8912 (28.2%) | 21943 (26.7%) |
Headache | ||||
   No, unk, na | 25909 (73.9%) | 12415 (80.3%) | 22102 (69.9%) | 60426 (73.6%) |
   Yes | 9139 (26.1%) | 3039 (19.7%) | 9497 (30.1%) | 21675 (26.4%) |
Black (N=1042) | Other, unknown or missing (N=63) | White (N=599) | Total (N=1704) | |
---|---|---|---|---|
Fever | ||||
   No, unk, na | 848 (81.4%) | 46 (73.0%) | 485 (81.0%) | 1379 (80.9%) |
   Yes | 194 (18.6%) | 17 (27.0%) | 114 (19.0%) | 325 (19.1%) |
Sore Throat | ||||
   No, unk, na | 1020 (97.9%) | 61 (96.8%) | 581 (97.0%) | 1662 (97.5%) |
   Yes | 22 (2.1%) | 2 (3.2%) | 18 (3.0%) | 42 (2.5%) |
Cough | ||||
   No, unk, na | 839 (80.5%) | 48 (76.2%) | 482 (80.5%) | 1369 (80.3%) |
   Yes | 203 (19.5%) | 15 (23.8%) | 117 (19.5%) | 335 (19.7%) |
Headache | ||||
   No, unk, na | 1007 (96.6%) | 61 (96.8%) | 577 (96.3%) | 1645 (96.5%) |
   Yes | 35 (3.4%) | 2 (3.2%) | 22 (3.7%) | 59 (3.5%) |
Making maps with R is almost a whole other workshop in and of itself. But let’s try a few simple maps to get started.
In the exercises below you will be using these packages:
leaflet
- learn more at https://rstudio.github.io/leaflet/sf
- here are places to learn more:
leaflet
Learn more about the leaflet
package.
Let’s look at the locations of the COVID deaths under review and color the points by gender.
Learn more with basemaps at https://rstudio.github.io/leaflet/basemaps.html.
In this part of the report, you will:
sf
package to lay out the geometry shapefiles for the zipcode boundaries in
Fulton County, GAdata.table
package to create an aggregated dataset with summaries of variables by
zipcodedplyr
package to
join the aggregated dataset variable to the shapefile dataset - see some
examples at https://statisticsglobe.com/aggregate-data-table-group-rRead in the SHP shapefile for Fulton County, GA using the
sf
package. Then plot the map.
## Reading layer `FultonCountyZipCodes' from data source
## `C:\MyGithub\Emory_RWorkshop_11Nov2022\FultonCountyZipCodes\FultonCountyZipCodes.shp'
## using driver `ESRI Shapefile'
## Simple feature collection with 48 features and 4 fields
## Geometry type: MULTIPOLYGON
## Dimension: XY
## Bounding box: xmin: 2087952 ymin: 1274336 xmax: 2317492 ymax: 1522856
## Projected CRS: NAD83 / Georgia West (ftUS)