Een post over opschonen en ontrafelen van data
Als je data krijgt is het belangrijk om over enkele technieken te beschikken de data goed te ontrafelen en schoon te maken. Het pakket tidyverse
is een standaardpakket waarmee je goed uit de voeten kunt. Ook het pakket janitor
hoort thuis in de gereedschapskist van de analyticus. Een aantal codes van dat janitor
pakket wilde ik goed leren kennen. Vandaar deze blog. Daarbij bouw ik voort op deze blog hier.
Eerst maar eens janitor
en tidyverse
laden en de data binnenhalen (wel eerst installeren als je deze pakketten niet hebt).
Eerst eens kijken hoe deze data eruit zien?
View(place_names)
Laten we een beetje met deze data werken. Eerst geven we de kolommen de naam columns
om te voorkomen dat het rommelig wordt. Vervolgens gebruiken we de separate()
functie om de kolommen te scheiden. Vervolgens filteren we de gegevens tot Berkshire County, omdat bij nadere inspectie van de gegevens duidelijk wordt dat er een paar items van buiten dit gebied zijn opgenomen. Dan gebruiken we mutate()
om verder op te ruimen. str_replace()
wordt gebruikt om de ID “598673” te vervangen door “598712,” een ID nummer dat al bestaat in de dataset, om zo een duplicaat ID te maken. Tenslotte wordt een extra kolom genaamd “extra_column” aangemaakt met NAs in elke rij:
colnames(place_names) = "columns"
place_names =
place_names %>%
separate(columns, c("Feature Name", "ID", "Class", "County", "State", "Latitude", "Longitude", "Ele(ft)", "Map", "BGN Date", "Entry Date"), sep = "[|]") %>%
filter(County == "Berkshire") %>%
mutate(
ID = str_replace(ID, "598673", "598712"),
extra_column = NA
)
non_ma_names
Voor we verder gaan, maken we snel ook een tweede dataset aan. Deze noemen we “non_ma_names”, met data die niet van Berkshire County afkomstig zijn. Nogmaals lezen we het “GNIS Query Result.csv” bestand in en scheiden de kolomnamen. Vervolgens gebruiken we de clean_names()
functie uit het janitor pakket, die we in de volgende sectie uitvoerig zullen behandelen. Tenslotte gebruiken we as.numeric()
en as.factor()
in een mutate stap om onze ele_ft variabele te transformeren naar een numerieke variabele en onze map variabele naar een factor:
non_ma_names = read.csv("data/GNIS Query Result.csv")
colnames(non_ma_names) = "columns"
non_ma_names =
non_ma_names %>%
separate(columns, c("Feature Name", "ID", "Class", "County", "State", "Latitude", "Longitude", "Ele(ft)", "Map", "BGN Date", "Entry Date"), sep = "[|]") %>%
filter(County != "Berkshire") %>%
clean_names() %>%
mutate(
ele_ft = as.numeric(ele_ft),
map = as.factor(map)
)
Laten we nu eens zien wat janitor
kan.
janitor
row_to_names()
Je hebt waarschijnlijk al heel wat databestanden ontvangen, waarschijnlijk in .xlsx-formaat. Bovenaan de spreadsheet staan er dan niet zelden een aantal rijen voordat de eigenlijke gegevens beginnen. Deze rijen kunnen leeg zijn of zijn gevuld met informatie en bedrijfslogo’s. Wanneer je dergelijke gegevens in R laadt, kan de inhoud van deze eerste rijen automatisch jouw kolomkoppen en eerste rijen worden. De functie row_to_names()
in het janitor
-pakket geeft joun de gelegenheid om aan te geven welke rij in jouw dataframe de eigenlijke kolomnamen bevat en om al het andere dat aan die rij voorafgaat te verwijderen. In onze dataset hadden de kolomnamen al de juiste plaats. Maar laten we deze functie toch eens proberen. We doen alsof de kolomnamen in de derde rij staan. We gebruiken de row_to_names()
-functie om een nieuw data frame te maken genaamd “test_names”. De row_to_names()
functie neemt de volgende argumenten: de gegevensbron, het rijnummer waar de kolomnamen vandaan moeten komen, of die rij moet worden verwijderd uit de gegevens, en of de rijen erboven moeten worden verwijderd uit de gegevens:
test_names = row_to_names(place_names, 3, remove_row = TRUE, remove_rows_above = TRUE)
clean_names()
clean_names()
functie wordt vaak gebruikt als je een nieuwe dataset in R laadt. Als je deze functie nog niet gebruikt, raad ik je sterk aan om deze in jouw workflow op te nemen. Het is niet voor niets de meest populaire functie uit het janitor
- pakket - het is uiterst nuttig! Laten we even terugkijken naar onze kolomnamen. Er zijn allerlei hoofdletters en spaties (b.v. “Feature Name”, “BGN Date”) en ook symbolen (“Ele(ft)”). De clean_names()
functie zet deze allemaal voor ons om naar kleine letters.
Het gebruik van clean_names()
is eenvoudig en kan als volgt worden uitgevoerd:
place_names = clean_names(place_names)
#OR
place_names =
place_names %>%
clean_names()
Zoals je ziet, heeft deze ene functie alle soorten rommelige kolomnamen verwerkt. Alles ziet er nu netjes en opgeruimd uit. Kijk maar eens
head(place_names)
feature_name id class county state latitude
1 A-Z Shopping Center 603538 Locale Berkshire MA 422755N
2 Abbey Hill 607260 Summit Berkshire MA 420822N
3 Abbey Lake 617758 Reservoir Berkshire MA 420818N
4 Abbey Lake Dam 604930 Dam Berkshire MA 420806N
5 Abbey Swamp 607261 Swamp Berkshire MA 420822N
6 Abbott Memorial School 598712 School Berkshire MA 424032N
longitude ele_ft map bgn_date entry_date extra_column
1 0731254W 1037 Pittsfield East 27-AUG-2002 NA
2 0730930W 1798 Monterey 24-FEB-1974 NA
3 0730908W 1463 Monterey 24-FEB-1974 NA
4 0730910W 1486 Monterey 27-AUG-2002 NA
5 0730930W 1798 Monterey 24-FEB-1974 NA
6 0730213W 1696 North Adams 27-AUG-2002 NA
remove_empty()
De remove_empty()
functie verwijdert, zoals de naam al zegt, kolommen die leeg zijn. We hebben een lege kolom gemaakt in ons “place_names” dataframe tijdens het voorbereiden van onze gegevens, dus we weten dat ten minste één kolom door deze functie zou moeten worden beïnvloed. Laten we het eens uitproberen:
place_names =
place_names %>%
remove_empty()
Zoals je kunt zien is de lege kolom (‘extra_column’) verdwenen en zijn er niet meer 12 maar 11 variabelen over.
De bgn_date
-kolom lijkt leeg, maar het feit dat deze niet is verwijderd door remove_empty()
vertelt ons dat er in ieder geval in één rij gegevens moeten zitten. Scroll maar in de dataset naar beneden en dan zie je het.
remove_constant()
De remove_constant()
functie verwijdert kolommen met dezelfde waarde in alle rijen. Onze dataset heeft er momenteel twee - omdat we de data hebben gefilterd tot Berkshire County, en heel Berkshire County in Massachusetts ligt, is county = “Berkshire” en staat = “MA” voor alle rijen. Deze rijen zijn niet bijzonder nuttig om in de dataset te houden omdat ze geen rij-specifieke informatie geven. We zouden simpelweg select()
kunnen gebruiken om deze kolommen te verwijderen, maar het voordeel van remove_constant()
is dat deze functie de aanname alle gegevens hetzelfde zijn
, dubbel controleert. In feite, door het gebruik van remove_constant()
werd ook duidelijk dat 38 van de 1968 items in de ruwe data eigenlijk niet van Berkshire Country waren! Net als remove_empty()
, is alle informatie die de remove_constant()
functie nodig heeft, de dataset waarop het moet werken:
place_names =
place_names %>%
remove_constant()
Zoals je kunt zien, zijn de variabelen Berkshire(county) en MA(staat) nu er uit en zijn er nog negen variabelen over.
compare_df_cols()
Ooit geprobeerd om rbind()
te gebruiken om twee data frames te stapelen en tegen een onverwachte fout aangelopen? De compare_df_cols()
functie vergelijkt direct de kolommen in twee dataframes en is ongelooflijk handig voor het oplossen van dit probleem. Laten we het eens proberen door ons “place_names” data frame te vergelijken met het data frame dat we hebben gemaakt met gegevens buiten Berkshire County, “non_ma_names”:
compare_df_cols(place_names, non_ma_names)
column_name place_names non_ma_names
1 bgn_date character character
2 class character character
3 county <NA> character
4 ele_ft character numeric
5 entry_date character character
6 feature_name character character
7 id character character
8 latitude character character
9 longitude character character
10 map character factor
11 state <NA> character
De output is een handige tabel waarin de twee dataframes worden vergeleken. We zien “NA” voor county en state in place_names en “character” voor deze variabelen in non_ma_names. Dit komt omdat we deze kolommen met remove_constant()
uit place_names hebben verwijderd, maar nooit iets hebben gedaan met de standaard karaktervariabelen in non_ma_names. We zien ook ele_ft als numeriek en map als een factor variabele in non_ma_names, die we specifiek hebben aangewezen tijdens datavoorbereiding. Als we deze dataframes zouden proberen samen te voegen, zou het nuttig zijn te weten welke kolommen ontbreken en welke kolommen inconsistente types hebben in de dataframes. In dataframes met veel kolommen kan compare_df_cols()
de tijd die nodig is om deze vergelijkingen te maken, aanzienlijk verminderen.
get_dupes()
Ik heb vaak gewerkt aan projecten met unieke patiënt-ID’s waarvan je niet verwacht dat ze dubbel voorkomen in je dataset. Er zijn tal van andere gevallen waarin je ervoor zou willen zorgen dat een ID-variabele volledig unieke waarden heeft, waaronder onze GNIS-gegevens. Zoals je je zult herinneren, hebben we een dubbele ID aangemaakt toen we onze data voorbereidden. Laten we eens kijken hoe get_dupes()
dit detecteert. De functie heeft enkel de naam van ons dataframe nodig en de naam van de kolom die als identifier fungeert:
get_dupes(place_names, id)
id dupe_count feature_name class latitude longitude
1 598712 2 Abbott Memorial School School 424032N 0730213W
2 598712 2 Abby Lodge School School 422440N 0731503W
ele_ft map bgn_date entry_date
1 1696 North Adams 27-AUG-2002
2 1076 Pittsfield West 27-AUG-2002
Zoals hieronder getoond, wordt het dataframe gefilterd tot de rijen met dubbele waarden in de kolom ID, zodat eventuele problemen gemakkelijk kunnen worden onderzocht:
De tabyl()
functie is vergelijkbaar met de table()
functie van tidyverse. Het is ook compatibel met het knitr pakket, en is erg handig voor data exploratie.Laten we het eerst uitproberen met een enkele variabele. Stel dat we geïnteresseerd zijn in hoeveel scholen er zijn in elk van de steden in Berkshire County. We filteren eerst onze klasse variabele op “School”, en gebruiken dan de tabyl() functie met onze map(locatie) variabele. Tenslotte pijpen we dat in knitr::kable() om de uitvoer in een mooie tabel te formatteren:
map | n | percent |
---|---|---|
Bash Bish Falls | 2 | 0.0143885 |
Becket | 4 | 0.0287770 |
Cheshire | 3 | 0.0215827 |
East Lee | 3 | 0.0215827 |
Egremont | 3 | 0.0215827 |
Great Barrington | 8 | 0.0575540 |
Hancock | 1 | 0.0071942 |
Monterey | 2 | 0.0143885 |
North Adams | 15 | 0.1079137 |
Peru | 1 | 0.0071942 |
Pittsfield East | 41 | 0.2949640 |
Pittsfield West | 18 | 0.1294964 |
Stockbridge | 21 | 0.1510791 |
Tolland Center | 1 | 0.0071942 |
Williamstown | 10 | 0.0719424 |
Windsor | 6 | 0.0431655 |
Het uitvoeren van deze zeer eenvoudige code levert de volgende uitvoertabel op:
Wanneer we ons Rmd bestand ‘knitten’, zal de kable()
functie de tabel mooi opmaken, zoals hierboven getoond. We krijgen een aantal scholen in elke stad, evenals het percentage van alle scholen in die stad. Het is gemakkelijk om opmerkingen te maken over deze gegevens, zoals dat 29,5% van alle scholen in Pittsfield East zijn, dat 41 scholen telt. Of dat 3 steden zo klein zijn dat ze maar 1 school hebben:
Laten we nu de kruistabellen van twee variabelen proberen. Laten we eens kijken hoeveel herkenningspunten van elk type aanwezig zijn in elke stad:
map | Airport | Arch | Basin | Bay | Bench | Bridge | Building | Cape | Cemetery | Census | Church | Civil | Cliff | Crossing | Dam | Falls | Flat | Forest | Gap | Hospital | Island | Lake | Locale | Military | Park | Populated Place | Post Office | Range | Rapids | Reserve | Reservoir | Ridge | School | Spring | Stream | Summit | Swamp | Tower | Trail | Valley | Woods |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Ashley Falls | 1 | 0 | 0 | 0 | 0 | 2 | 7 | 0 | 5 | 0 | 1 | 1 | 0 | 0 | 2 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 6 | 3 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 8 | 8 | 1 | 0 | 0 | 1 | 0 |
Bash Bish Falls | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 5 | 3 | 0 | 1 | 0 | 0 | 1 | 6 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 5 | 0 | 2 | 0 | 8 | 9 | 1 | 2 | 3 | 2 | 0 |
Becket | 0 | 0 | 1 | 0 | 0 | 0 | 8 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 8 | 0 | 0 | 2 | 0 | 0 | 0 | 2 | 0 | 0 | 2 | 8 | 1 | 0 | 0 | 0 | 7 | 0 | 4 | 0 | 13 | 5 | 0 | 0 | 0 | 0 | 0 |
Berlin | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 2 | 0 | 0 | 0 | 1 | 1 | 0 |
B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 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 | 0 | 0 | 0 | 0 | 0 | 0 |
Een deel van onze tabel (eenmaal ‘geknit’) is hierboven afgebeeld. Voor elke stad kunnen we duidelijk zien hoeveel van elk oriëntatiepunttype er in de database zitten:
Hoewel eenvoudige tellingen als deze heel nuttig kunnen zijn, geven we misschien meer om kolompercentages. Met andere woorden, hoeveel procent van de items voor elk oriëntatiepunttype zijn er in elke stad? Dit is gemakkelijk te onderzoeken met tabyl()
via de adorn_percentages()
functie:
place_names %>%
tabyl(map, class) %>%
adorn_percentages("col") %>%
knitr::kable()
map | Airport | Arch | Basin | Bay | Bench | Bridge | Building | Cape | Cemetery | Census | Church | Civil | Cliff | Crossing | Dam | Falls | Flat | Forest | Gap | Hospital | Island | Lake | Locale | Military | Park | Populated Place | Post Office | Range | Rapids | Reserve | Reservoir | Ridge | School | Spring | Stream | Summit | Swamp | Tower | Trail | Valley | Woods |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Ashley Falls | 0.0909091 | 0 | 0.0000000 | 0 | 0 | 0.4 | 0.0341463 | 0.0000000 | 0.0649351 | 0.000 | 0.0090090 | 0.0303030 | 0.0 | 0.0000000 | 0.0204082 | 0.0833333 | 1 | 0.0000 | 0.0000000 | 0.000 | 0.00 | 0.0000000 | 0.0000000 | 0 | 0.0235294 | 0.03750 | 0.0326087 | 0.00 | 0 | 0.0000000 | 0.0000000 | 0.0000000 | 0.0000000 | 0.00 | 0.0306513 | 0.0421053 | 0.0625 | 0.0000000 | 0.0000000 | 0.0625 | 0 |
Bash Bish Falls | 0.0000000 | 0 | 0.0000000 | 0 | 0 | 0.0 | 0.0000000 | 0.0000000 | 0.0129870 | 0.000 | 0.0090090 | 0.0303030 | 0.0 | 0.0000000 | 0.0510204 | 0.2500000 | 0 | 0.0625 | 0.0000000 | 0.000 | 0.25 | 0.0769231 | 0.0000000 | 0 | 0.0000000 | 0.00625 | 0.0108696 | 0.00 | 0 | 0.0000000 | 0.0431034 | 0.0000000 | 0.0143885 | 0.00 | 0.0306513 | 0.0473684 | 0.0625 | 0.0833333 | 0.1764706 | 0.1250 | 0 |
Becket | 0.0000000 | 0 | 0.3333333 | 0 | 0 | 0.0 | 0.0390244 | 0.0000000 | 0.0129870 | 0.000 | 0.0090090 | 0.0303030 | 0.0 | 0.0000000 | 0.0816327 | 0.0000000 | 0 | 0.1250 | 0.0000000 | 0.000 | 0.00 | 0.0256410 | 0.0000000 | 0 | 0.0235294 | 0.05000 | 0.0108696 | 0.00 | 0 | 0.0000000 | 0.0603448 | 0.0000000 | 0.0287770 | 0.00 | 0.0498084 | 0.0263158 | 0.0000 | 0.0000000 | 0.0000000 | 0.0000 | 0 |
Berlin | 0.0000000 | 0 | 0.0000000 | 0 | 0 | 0.0 | 0.0000000 | 0.0000000 | 0.0000000 | 0.000 | 0.0090090 | 0.0000000 | 0.0 | 0.0000000 | 0.0000000 | 0.0000000 | 0 | 0.0625 | 0.0000000 | 0.000 | 0.00 | 0.0000000 | 0.0303030 | 0 | 0.0117647 | 0.00000 | 0.0000000 | 0.00 | 0 | 0.0000000 | 0.0000000 | 0.0000000 | 0.0000000 | 0.25 | 0.0076628 | 0.0000000 | 0.0000 | 0.0000000 | 0.0588235 | 0.0625 | 0 |
Bristol | 0.0000000 | 0 | 0.0000000 | 0 | 0 | 0.0 | 0.0000000 | 0.0000000 | 0.0000000 | 0.000 | 0.0000000 | 0.0000000 | 0.0 | 0.0000000 | 0.0000000 | 0.0000000 | 0 | 0.0000 | 0.0000000 | 0.000 | 0.00 | 0.0000000 | 0.0000000 | 0 | 0.0000000 | 0.00000 | 0.0000000 | 0.00 | 0 | 0.0000000 | 0.0000000 | 0.0000000 | 0.0000000 | 0.00 | 0.0000000 | 0.0000000 | 0.0000 | 0.0000000 | 0.0588235 | 0.0000 | 0 |
Canaan | 0.0000000 | 0 | 0.0000000 | 0 | 0 | 0.0 | 0.0000000 | 0.0000000 | 0.0000000 | 0.000 | 0.0000000 | 0.0000000 | 0.0 | 0.0000000 | 0.0000000 | 0.0000000 | 0 | 0.0000 | 0.0000000 | 0.000 | 0.00 | 0.0000000 | 0.0101010 | 0 | 0.0000000 | 0.00000 | 0.0000000 | 0.00 | 0 | 0.0000000 | 0.0000000 | 0.0000000 | 0.0000000 | 0.00 | 0.0000000 | 0.0052632 | 0.0000 | 0.0000000 | 0.0000000 | 0.0000 | 0 |
Cheshire | 0.0000000 | 0 | 0.0000000 | 0 | 0 | 0.0 | 0.0585366 | 0.0000000 | 0.0649351 | 0.125 | 0.0360360 | 0.0909091 | 0.2 | 0.0000000 | 0.0204082 | 0.0000000 | 0 | 0.0000 | 0.0000000 | 0.000 | 0.25 | 0.0512821 | 0.0606061 | 0 | 0.0235294 | 0.06875 | 0.0326087 | 0.00 | 0 | 0.0000000 | 0.0172414 | 0.0000000 | 0.0215827 | 0.00 | 0.0536398 | 0.0789474 | 0.0000 | 0.0000000 | 0.0588235 | 0.0000 | 0 |
Chester | 0.0000000 | 0 | 0.0000000 | 0 | 0 | 0.0 | 0.0000000 | 0.0000000 | 0.0000000 | 0.000 | 0.0000000 | 0.0000000 | 0.0 | 0.0000000 | 0.0000000 | 0.0000000 | 0 | 0.0000 | 0.0000000 | 0.000 | 0.00 | 0.0000000 | 0.0000000 | 0 | 0.0000000 | 0.00000 | 0.0000000 | 0.00 | 0 | 0.0000000 | 0.0000000 | 0.0000000 | 0.0000000 | 0.00 | 0.0038314 | 0.0000000 | 0.0000 | 0.0000000 | 0.0000000 | 0.0000 | 0 |
Copake | 0.0000000 | 0 | 0.0000000 | 0 | 0 | 0.0 | 0.0000000 | 0.0000000 | 0.0000000 | 0.000 | 0.0000000 | 0.0000000 | 0.0 | 0.0000000 | 0.0000000 | 0.0000000 | 0 | 0.0000 | 0.0000000 | 0.000 | 0.00 | 0.0000000 | 0.0000000 | 0 | 0.0000000 | 0.00000 | 0.0000000 | 0.00 | 0 | 0.0000000 | 0.0000000 | 0.0000000 | 0.0000000 | 0.00 | 0.0038314 | 0.0052632 | 0.0000 | 0.0000000 | 0.0000000 | 0.0000 | 0 |
East Lee | 0.0909091 | 0 | 0.0000000 | 0 | 0 | 0.0 | 0.0292683 | 0.0000000 | 0.0129870 | 0.125 | 0.0360360 | 0.0909091 | 0.0 | 0.3333333 | 0.0816327 | 0.0000000 | 0 | 0.0625 | 0.0000000 | 0.000 | 0.00 | 0.0512821 | 0.0303030 | 0 | 0.0000000 | 0.03750 | 0.0108696 | 0.00 | 0 | 0.0000000 | 0.1034483 | 0.0000000 | 0.0215827 | 0.00 | 0.0536398 | 0.0263158 | 0.0625 | 0.0000000 | 0.0000000 | 0.0000 | 0 |
Egremont | 0.0909091 | 0 | 0.0000000 | 0 | 0 | 0.0 | 0.0390244 | 0.0000000 | 0.0389610 | 0.000 | 0.0090090 | 0.0606061 | 0.2 | 0.0000000 | 0.0306122 | 0.0000000 | 0 | 0.0625 | 0.0000000 | 0.000 | 0.00 | 0.0512821 | 0.0101010 | 0 | 0.0352941 | 0.02500 | 0.0108696 | 0.00 | 0 | 0.0000000 | 0.0431034 | 0.0000000 | 0.0215827 | 0.00 | 0.0229885 | 0.0526316 | 0.0000 | 0.0416667 | 0.0000000 | 0.0000 | 0 |
Great Barrington | 0.0000000 | 0 | 0.3333333 | 0 | 0 | 0.0 | 0.0292683 | 0.0000000 | 0.0389610 | 0.250 | 0.0540541 | 0.0303030 | 0.0 | 0.0000000 | 0.0714286 | 0.0000000 | 0 | 0.1250 | 0.3333333 | 0.125 | 0.00 | 0.0769231 | 0.0505051 | 0 | 0.0235294 | 0.04375 | 0.0108696 | 0.00 | 0 | 0.0000000 | 0.0775862 | 0.0000000 | 0.0575540 | 0.25 | 0.0153257 | 0.0473684 | 0.0625 | 0.0416667 | 0.0588235 | 0.0625 | 0 |
Hancock | 0.0000000 | 0 | 0.0000000 | 0 | 0 | 0.0 | 0.0146341 | 0.0000000 | 0.0259740 | 0.000 | 0.0000000 | 0.0303030 | 0.0 | 0.0000000 | 0.0000000 | 0.0000000 | 0 | 0.0000 | 0.0000000 | 0.000 | 0.00 | 0.0128205 | 0.0202020 | 0 | 0.0235294 | 0.01250 | 0.0108696 | 0.00 | 0 | 0.0000000 | 0.0000000 | 0.1666667 | 0.0071942 | 0.00 | 0.0306513 | 0.0684211 | 0.0000 | 0.0000000 | 0.0000000 | 0.1875 | 0 |
Monterey | 0.0000000 | 0 | 0.0000000 | 0 | 0 | 0.0 | 0.0243902 | 0.0000000 | 0.0259740 | 0.000 | 0.0270270 | 0.0606061 | 0.0 | 0.0000000 | 0.1122449 | 0.0000000 | 0 | 0.0000 | 0.0000000 | 0.000 | 0.00 | 0.0384615 | 0.0404040 | 0 | 0.0117647 | 0.03125 | 0.0217391 | 0.25 | 0 | 0.0000000 | 0.1120690 | 0.0000000 | 0.0143885 | 0.00 | 0.0229885 | 0.0684211 | 0.3750 | 0.0000000 | 0.0000000 | 0.0625 | 0 |
North Adams | 0.0000000 | 1 | 0.0000000 | 0 | 1 | 0.0 | 0.0926829 | 0.0000000 | 0.1168831 | 0.125 | 0.0630631 | 0.1212121 | 0.2 | 0.0000000 | 0.0714286 | 0.0833333 | 0 | 0.0625 | 0.1666667 | 0.125 | 0.00 | 0.0769231 | 0.0404040 | 0 | 0.1647059 | 0.06875 | 0.0108696 | 0.25 | 0 | 0.0000000 | 0.0689655 | 0.0000000 | 0.1079137 | 0.00 | 0.0842912 | 0.0315789 | 0.0625 | 0.1250000 | 0.0588235 | 0.0000 | 0 |
Otis | 0.0000000 | 0 | 0.0000000 | 1 | 0 | 0.0 | 0.0195122 | 0.3333333 | 0.0259740 | 0.000 | 0.0000000 | 0.0303030 | 0.0 | 0.0000000 | 0.0918367 | 0.0833333 | 0 | 0.0000 | 0.0000000 | 0.000 | 0.50 | 0.1282051 | 0.0404040 | 0 | 0.0000000 | 0.03750 | 0.0217391 | 0.00 | 0 | 0.0000000 | 0.0948276 | 0.1666667 | 0.0000000 | 0.00 | 0.0306513 | 0.0368421 | 0.0000 | 0.0000000 | 0.0000000 | 0.0000 | 0 |
Peru | 0.0000000 | 0 | 0.0000000 | 0 | 0 | 0.0 | 0.0243902 | 0.0000000 | 0.0259740 | 0.000 | 0.0000000 | 0.0606061 | 0.0 | 0.0000000 | 0.0408163 | 0.0833333 | 0 | 0.0625 | 0.0000000 | 0.000 | 0.00 | 0.0384615 | 0.0101010 | 0 | 0.0470588 | 0.03750 | 0.0000000 | 0.00 | 0 | 0.3333333 | 0.0344828 | 0.0000000 | 0.0071942 | 0.00 | 0.0574713 | 0.0368421 | 0.0000 | 0.0000000 | 0.0000000 | 0.0000 | 0 |
Pittsfield East | 0.0909091 | 0 | 0.0000000 | 0 | 0 | 0.0 | 0.1414634 | 0.0000000 | 0.0779221 | 0.000 | 0.3333333 | 0.0303030 | 0.0 | 0.0000000 | 0.0714286 | 0.0000000 | 0 | 0.0000 | 0.1666667 | 0.250 | 0.00 | 0.0256410 | 0.1919192 | 0 | 0.1882353 | 0.13125 | 0.6413043 | 0.00 | 0 | 0.0000000 | 0.1379310 | 0.1666667 | 0.2949640 | 0.00 | 0.0536398 | 0.0473684 | 0.0000 | 0.0833333 | 0.0000000 | 0.0000 | 0 |
Pittsfield West | 0.0909091 | 0 | 0.0000000 | 0 | 0 | 0.0 | 0.1170732 | 0.3333333 | 0.0909091 | 0.000 | 0.1711712 | 0.0606061 | 0.2 | 0.0000000 | 0.0204082 | 0.0833333 | 0 | 0.0625 | 0.0000000 | 0.125 | 0.00 | 0.0641026 | 0.1717172 | 0 | 0.1058824 | 0.05625 | 0.0108696 | 0.25 | 0 | 0.0000000 | 0.0258621 | 0.1666667 | 0.1294964 | 0.00 | 0.0957854 | 0.0736842 | 0.0625 | 0.2916667 | 0.1764706 | 0.1250 | 0 |
Plainfield | 0.0000000 | 0 | 0.0000000 | 0 | 0 | 0.0 | 0.0000000 | 0.0000000 | 0.0259740 | 0.000 | 0.0000000 | 0.0000000 | 0.0 | 0.0000000 | 0.0000000 | 0.0833333 | 0 | 0.0000 | 0.0000000 | 0.000 | 0.00 | 0.0000000 | 0.0000000 | 0 | 0.0000000 | 0.00625 | 0.0000000 | 0.00 | 0 | 0.0000000 | 0.0000000 | 0.0000000 | 0.0000000 | 0.00 | 0.0306513 | 0.0052632 | 0.0000 | 0.0000000 | 0.0000000 | 0.0000 | 0 |
Rowe | 0.0000000 | 0 | 0.0000000 | 0 | 0 | 0.2 | 0.0000000 | 0.0000000 | 0.0000000 | 0.000 | 0.0000000 | 0.0000000 | 0.0 | 0.3333333 | 0.0102041 | 0.0000000 | 0 | 0.0000 | 0.0000000 | 0.000 | 0.00 | 0.0000000 | 0.0303030 | 0 | 0.0117647 | 0.01250 | 0.0000000 | 0.00 | 0 | 0.0000000 | 0.0172414 | 0.1666667 | 0.0000000 | 0.00 | 0.0498084 | 0.0105263 | 0.0000 | 0.0000000 | 0.0000000 | 0.0000 | 0 |
South Sandisfield | 0.0000000 | 0 | 0.0000000 | 0 | 0 | 0.0 | 0.0097561 | 0.0000000 | 0.0649351 | 0.000 | 0.0180180 | 0.0303030 | 0.0 | 0.0000000 | 0.0612245 | 0.0833333 | 0 | 0.1250 | 0.0000000 | 0.000 | 0.00 | 0.0384615 | 0.0101010 | 0 | 0.0000000 | 0.03750 | 0.0108696 | 0.00 | 0 | 0.0000000 | 0.0344828 | 0.0000000 | 0.0000000 | 0.00 | 0.0076628 | 0.0368421 | 0.1250 | 0.0000000 | 0.0000000 | 0.0000 | 0 |
Southbury | 0.0000000 | 0 | 0.0000000 | 0 | 0 | 0.0 | 0.0000000 | 0.0000000 | 0.0000000 | 0.000 | 0.0000000 | 0.0000000 | 0.0 | 0.0000000 | 0.0000000 | 0.0000000 | 0 | 0.0000 | 0.0000000 | 0.000 | 0.00 | 0.0000000 | 0.0000000 | 0 | 0.0117647 | 0.00000 | 0.0000000 | 0.00 | 0 | 0.0000000 | 0.0000000 | 0.0000000 | 0.0000000 | 0.00 | 0.0000000 | 0.0000000 | 0.0000 | 0.0000000 | 0.0000000 | 0.0000 | 0 |
State Line | 0.0000000 | 0 | 0.0000000 | 0 | 0 | 0.0 | 0.0000000 | 0.0000000 | 0.0519481 | 0.000 | 0.0000000 | 0.0303030 | 0.0 | 0.0000000 | 0.0102041 | 0.0000000 | 0 | 0.0000 | 0.0000000 | 0.000 | 0.00 | 0.0769231 | 0.0202020 | 0 | 0.0000000 | 0.04375 | 0.0108696 | 0.00 | 0 | 0.0000000 | 0.0000000 | 0.0000000 | 0.0000000 | 0.00 | 0.0191571 | 0.0210526 | 0.0000 | 0.0000000 | 0.0000000 | 0.0000 | 0 |
Stockbridge | 0.0000000 | 0 | 0.0000000 | 0 | 0 | 0.0 | 0.1707317 | 0.0000000 | 0.0909091 | 0.250 | 0.0540541 | 0.0606061 | 0.0 | 0.3333333 | 0.0714286 | 0.0000000 | 0 | 0.0000 | 0.1666667 | 0.125 | 0.00 | 0.1282051 | 0.0707071 | 0 | 0.0823529 | 0.11250 | 0.0869565 | 0.00 | 0 | 0.0000000 | 0.0517241 | 0.0000000 | 0.1510791 | 0.00 | 0.0766284 | 0.0526316 | 0.0625 | 0.1666667 | 0.0000000 | 0.0625 | 1 |
Tolland Center | 0.0000000 | 0 | 0.0000000 | 0 | 0 | 0.0 | 0.0146341 | 0.0000000 | 0.0129870 | 0.000 | 0.0000000 | 0.0303030 | 0.0 | 0.0000000 | 0.0408163 | 0.0000000 | 0 | 0.0000 | 0.0000000 | 0.000 | 0.00 | 0.0256410 | 0.0101010 | 0 | 0.0000000 | 0.01875 | 0.0217391 | 0.00 | 0 | 0.0000000 | 0.0258621 | 0.0000000 | 0.0071942 | 0.00 | 0.0229885 | 0.0315789 | 0.0000 | 0.0000000 | 0.0000000 | 0.0000 | 0 |
Williamstown | 0.2727273 | 0 | 0.3333333 | 0 | 0 | 0.4 | 0.0926829 | 0.3333333 | 0.0519481 | 0.125 | 0.1261261 | 0.0303030 | 0.2 | 0.0000000 | 0.0306122 | 0.0833333 | 0 | 0.0625 | 0.1666667 | 0.000 | 0.00 | 0.0128205 | 0.1313131 | 1 | 0.1529412 | 0.08125 | 0.0108696 | 0.25 | 1 | 0.0000000 | 0.0431034 | 0.1666667 | 0.0719424 | 0.50 | 0.0766284 | 0.1000000 | 0.0625 | 0.1250000 | 0.3529412 | 0.2500 | 0 |
Windsor | 0.1818182 | 0 | 0.0000000 | 0 | 0 | 0.0 | 0.0487805 | 0.0000000 | 0.0519481 | 0.000 | 0.0360360 | 0.0606061 | 0.0 | 0.0000000 | 0.0102041 | 0.0833333 | 0 | 0.1250 | 0.0000000 | 0.250 | 0.00 | 0.0000000 | 0.0202020 | 0 | 0.0588235 | 0.03750 | 0.0217391 | 0.00 | 0 | 0.6666667 | 0.0086207 | 0.0000000 | 0.0431655 | 0.00 | 0.0459770 | 0.0473684 | 0.0000 | 0.0416667 | 0.0000000 | 0.0000 | 0 |
Worthington | 0.0909091 | 0 | 0.0000000 | 0 | 0 | 0.0 | 0.0000000 | 0.0000000 | 0.0129870 | 0.000 | 0.0000000 | 0.0000000 | 0.0 | 0.0000000 | 0.0000000 | 0.0000000 | 0 | 0.0000 | 0.0000000 | 0.000 | 0.00 | 0.0000000 | 0.0000000 | 0 | 0.0000000 | 0.00625 | 0.0000000 | 0.00 | 0 | 0.0000000 | 0.0000000 | 0.0000000 | 0.0000000 | 0.00 | 0.0229885 | 0.0000000 | 0.0000 | 0.0000000 | 0.0000000 | 0.0000 | 0 |
Nu zien we deze kolompercentages in plaats van tellingen, maar de tabel is nogal moeilijk te lezen.
We kunnen dit een beetje opschonen met de adorn_pct_formatting()
functie, die de gebruiker toestaat het aantal decimalen op te geven dat in de uitvoer moet worden opgenomen. Precisie is niet bijzonder belangrijk voor deze verkennende tabel, dus laten we 0 decimalen gebruiken om deze tabel makkelijker leesbaar te maken:
place_names %>%
tabyl(map, class) %>%
adorn_percentages("col") %>%
adorn_pct_formatting(digits = 0) %>%
knitr::kable()
map | Airport | Arch | Basin | Bay | Bench | Bridge | Building | Cape | Cemetery | Census | Church | Civil | Cliff | Crossing | Dam | Falls | Flat | Forest | Gap | Hospital | Island | Lake | Locale | Military | Park | Populated Place | Post Office | Range | Rapids | Reserve | Reservoir | Ridge | School | Spring | Stream | Summit | Swamp | Tower | Trail | Valley | Woods |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Ashley Falls | 9% | 0% | 0% | 0% | 0% | 40% | 3% | 0% | 6% | 0% | 1% | 3% | 0% | 0% | 2% | 8% | 100% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 2% | 4% | 3% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 3% | 4% | 6% | 0% | 0% | 6% | 0% |
Bash Bish Falls | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 1% | 0% | 1% | 3% | 0% | 0% | 5% | 25% | 0% | 6% | 0% | 0% | 25% | 8% | 0% | 0% | 0% | 1% | 1% | 0% | 0% | 0% | 4% | 0% | 1% | 0% | 3% | 5% | 6% | 8% | 18% | 12% | 0% |
Becket | 0% | 0% | 33% | 0% | 0% | 0% | 4% | 0% | 1% | 0% | 1% | 3% | 0% | 0% | 8% | 0% | 0% | 12% | 0% | 0% | 0% | 3% | 0% | 0% | 2% | 5% | 1% | 0% | 0% | 0% | 6% | 0% | 3% | 0% | 5% | 3% | 0% | 0% | 0% | 0% | 0% |
Berlin | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 1% | 0% | 0% | 0% | 0% | 0% | 0% | 6% | 0% | 0% | 0% | 0% | 3% | 0% | 1% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 25% | 1% | 0% | 0% | 0% | 6% | 6% | 0% |
Bristol | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 6% | 0% | 0% |
Canaan | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 1% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 1% | 0% | 0% | 0% | 0% | 0% |
Cheshire | 0% | 0% | 0% | 0% | 0% | 0% | 6% | 0% | 6% | 12% | 4% | 9% | 20% | 0% | 2% | 0% | 0% | 0% | 0% | 0% | 25% | 5% | 6% | 0% | 2% | 7% | 3% | 0% | 0% | 0% | 2% | 0% | 2% | 0% | 5% | 8% | 0% | 0% | 6% | 0% | 0% |
Chester | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% |
Copake | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 1% | 0% | 0% | 0% | 0% | 0% |
East Lee | 9% | 0% | 0% | 0% | 0% | 0% | 3% | 0% | 1% | 12% | 4% | 9% | 0% | 33% | 8% | 0% | 0% | 6% | 0% | 0% | 0% | 5% | 3% | 0% | 0% | 4% | 1% | 0% | 0% | 0% | 10% | 0% | 2% | 0% | 5% | 3% | 6% | 0% | 0% | 0% | 0% |
Egremont | 9% | 0% | 0% | 0% | 0% | 0% | 4% | 0% | 4% | 0% | 1% | 6% | 20% | 0% | 3% | 0% | 0% | 6% | 0% | 0% | 0% | 5% | 1% | 0% | 4% | 2% | 1% | 0% | 0% | 0% | 4% | 0% | 2% | 0% | 2% | 5% | 0% | 4% | 0% | 0% | 0% |
Great Barrington | 0% | 0% | 33% | 0% | 0% | 0% | 3% | 0% | 4% | 25% | 5% | 3% | 0% | 0% | 7% | 0% | 0% | 12% | 33% | 12% | 0% | 8% | 5% | 0% | 2% | 4% | 1% | 0% | 0% | 0% | 8% | 0% | 6% | 25% | 2% | 5% | 6% | 4% | 6% | 6% | 0% |
Hancock | 0% | 0% | 0% | 0% | 0% | 0% | 1% | 0% | 3% | 0% | 0% | 3% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 1% | 2% | 0% | 2% | 1% | 1% | 0% | 0% | 0% | 0% | 17% | 1% | 0% | 3% | 7% | 0% | 0% | 0% | 19% | 0% |
Monterey | 0% | 0% | 0% | 0% | 0% | 0% | 2% | 0% | 3% | 0% | 3% | 6% | 0% | 0% | 11% | 0% | 0% | 0% | 0% | 0% | 0% | 4% | 4% | 0% | 1% | 3% | 2% | 25% | 0% | 0% | 11% | 0% | 1% | 0% | 2% | 7% | 38% | 0% | 0% | 6% | 0% |
North Adams | 0% | 100% | 0% | 0% | 100% | 0% | 9% | 0% | 12% | 12% | 6% | 12% | 20% | 0% | 7% | 8% | 0% | 6% | 17% | 12% | 0% | 8% | 4% | 0% | 16% | 7% | 1% | 25% | 0% | 0% | 7% | 0% | 11% | 0% | 8% | 3% | 6% | 12% | 6% | 0% | 0% |
Otis | 0% | 0% | 0% | 100% | 0% | 0% | 2% | 33% | 3% | 0% | 0% | 3% | 0% | 0% | 9% | 8% | 0% | 0% | 0% | 0% | 50% | 13% | 4% | 0% | 0% | 4% | 2% | 0% | 0% | 0% | 9% | 17% | 0% | 0% | 3% | 4% | 0% | 0% | 0% | 0% | 0% |
Peru | 0% | 0% | 0% | 0% | 0% | 0% | 2% | 0% | 3% | 0% | 0% | 6% | 0% | 0% | 4% | 8% | 0% | 6% | 0% | 0% | 0% | 4% | 1% | 0% | 5% | 4% | 0% | 0% | 0% | 33% | 3% | 0% | 1% | 0% | 6% | 4% | 0% | 0% | 0% | 0% | 0% |
Pittsfield East | 9% | 0% | 0% | 0% | 0% | 0% | 14% | 0% | 8% | 0% | 33% | 3% | 0% | 0% | 7% | 0% | 0% | 0% | 17% | 25% | 0% | 3% | 19% | 0% | 19% | 13% | 64% | 0% | 0% | 0% | 14% | 17% | 29% | 0% | 5% | 5% | 0% | 8% | 0% | 0% | 0% |
Pittsfield West | 9% | 0% | 0% | 0% | 0% | 0% | 12% | 33% | 9% | 0% | 17% | 6% | 20% | 0% | 2% | 8% | 0% | 6% | 0% | 12% | 0% | 6% | 17% | 0% | 11% | 6% | 1% | 25% | 0% | 0% | 3% | 17% | 13% | 0% | 10% | 7% | 6% | 29% | 18% | 12% | 0% |
Plainfield | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 3% | 0% | 0% | 0% | 0% | 0% | 0% | 8% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 1% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 3% | 1% | 0% | 0% | 0% | 0% | 0% |
Rowe | 0% | 0% | 0% | 0% | 0% | 20% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 33% | 1% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 3% | 0% | 1% | 1% | 0% | 0% | 0% | 0% | 2% | 17% | 0% | 0% | 5% | 1% | 0% | 0% | 0% | 0% | 0% |
South Sandisfield | 0% | 0% | 0% | 0% | 0% | 0% | 1% | 0% | 6% | 0% | 2% | 3% | 0% | 0% | 6% | 8% | 0% | 12% | 0% | 0% | 0% | 4% | 1% | 0% | 0% | 4% | 1% | 0% | 0% | 0% | 3% | 0% | 0% | 0% | 1% | 4% | 12% | 0% | 0% | 0% | 0% |
Southbury | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 1% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% |
State Line | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 5% | 0% | 0% | 3% | 0% | 0% | 1% | 0% | 0% | 0% | 0% | 0% | 0% | 8% | 2% | 0% | 0% | 4% | 1% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 2% | 2% | 0% | 0% | 0% | 0% | 0% |
Stockbridge | 0% | 0% | 0% | 0% | 0% | 0% | 17% | 0% | 9% | 25% | 5% | 6% | 0% | 33% | 7% | 0% | 0% | 0% | 17% | 12% | 0% | 13% | 7% | 0% | 8% | 11% | 9% | 0% | 0% | 0% | 5% | 0% | 15% | 0% | 8% | 5% | 6% | 17% | 0% | 6% | 100% |
Tolland Center | 0% | 0% | 0% | 0% | 0% | 0% | 1% | 0% | 1% | 0% | 0% | 3% | 0% | 0% | 4% | 0% | 0% | 0% | 0% | 0% | 0% | 3% | 1% | 0% | 0% | 2% | 2% | 0% | 0% | 0% | 3% | 0% | 1% | 0% | 2% | 3% | 0% | 0% | 0% | 0% | 0% |
Williamstown | 27% | 0% | 33% | 0% | 0% | 40% | 9% | 33% | 5% | 12% | 13% | 3% | 20% | 0% | 3% | 8% | 0% | 6% | 17% | 0% | 0% | 1% | 13% | 100% | 15% | 8% | 1% | 25% | 100% | 0% | 4% | 17% | 7% | 50% | 8% | 10% | 6% | 12% | 35% | 25% | 0% |
Windsor | 18% | 0% | 0% | 0% | 0% | 0% | 5% | 0% | 5% | 0% | 4% | 6% | 0% | 0% | 1% | 8% | 0% | 12% | 0% | 25% | 0% | 0% | 2% | 0% | 6% | 4% | 2% | 0% | 0% | 67% | 1% | 0% | 4% | 0% | 5% | 5% | 0% | 4% | 0% | 0% | 0% |
Worthington | 9% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 1% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 1% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 2% | 0% | 0% | 0% | 0% | 0% | 0% |
Veel beter! Nu is het veel gemakkelijker om de tabel te lezen en onze kolompercentages te begrijpen:
Het is net zo eenvoudig om adorn_percentages()
te gebruiken om in plaats daarvan naar rij percentages te kijken (in ons geval, het percentage vermeldingen van elke stad dat behoort tot elk oriëntatiepunt type):
place_names %>%
tabyl(map, class) %>%
adorn_percentages("col") %>%
adorn_pct_formatting(digits = 0) %>%
knitr::kable()
map | Airport | Arch | Basin | Bay | Bench | Bridge | Building | Cape | Cemetery | Census | Church | Civil | Cliff | Crossing | Dam | Falls | Flat | Forest | Gap | Hospital | Island | Lake | Locale | Military | Park | Populated Place | Post Office | Range | Rapids | Reserve | Reservoir | Ridge | School | Spring | Stream | Summit | Swamp | Tower | Trail | Valley | Woods |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Ashley Falls | 9% | 0% | 0% | 0% | 0% | 40% | 3% | 0% | 6% | 0% | 1% | 3% | 0% | 0% | 2% | 8% | 100% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 2% | 4% | 3% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 3% | 4% | 6% | 0% | 0% | 6% | 0% |
Bash Bish Falls | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 1% | 0% | 1% | 3% | 0% | 0% | 5% | 25% | 0% | 6% | 0% | 0% | 25% | 8% | 0% | 0% | 0% | 1% | 1% | 0% | 0% | 0% | 4% | 0% | 1% | 0% | 3% | 5% | 6% | 8% | 18% | 12% | 0% |
Becket | 0% | 0% | 33% | 0% | 0% | 0% | 4% | 0% | 1% | 0% | 1% | 3% | 0% | 0% | 8% | 0% | 0% | 12% | 0% | 0% | 0% | 3% | 0% | 0% | 2% | 5% | 1% | 0% | 0% | 0% | 6% | 0% | 3% | 0% | 5% | 3% | 0% | 0% | 0% | 0% | 0% |
Berlin | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 1% | 0% | 0% | 0% | 0% | 0% | 0% | 6% | 0% | 0% | 0% | 0% | 3% | 0% | 1% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 25% | 1% | 0% | 0% | 0% | 6% | 6% | 0% |
Bristol | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 6% | 0% | 0% |
Canaan | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 1% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 1% | 0% | 0% | 0% | 0% | 0% |
Cheshire | 0% | 0% | 0% | 0% | 0% | 0% | 6% | 0% | 6% | 12% | 4% | 9% | 20% | 0% | 2% | 0% | 0% | 0% | 0% | 0% | 25% | 5% | 6% | 0% | 2% | 7% | 3% | 0% | 0% | 0% | 2% | 0% | 2% | 0% | 5% | 8% | 0% | 0% | 6% | 0% | 0% |
Chester | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% |
Copake | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 1% | 0% | 0% | 0% | 0% | 0% |
East Lee | 9% | 0% | 0% | 0% | 0% | 0% | 3% | 0% | 1% | 12% | 4% | 9% | 0% | 33% | 8% | 0% | 0% | 6% | 0% | 0% | 0% | 5% | 3% | 0% | 0% | 4% | 1% | 0% | 0% | 0% | 10% | 0% | 2% | 0% | 5% | 3% | 6% | 0% | 0% | 0% | 0% |
Egremont | 9% | 0% | 0% | 0% | 0% | 0% | 4% | 0% | 4% | 0% | 1% | 6% | 20% | 0% | 3% | 0% | 0% | 6% | 0% | 0% | 0% | 5% | 1% | 0% | 4% | 2% | 1% | 0% | 0% | 0% | 4% | 0% | 2% | 0% | 2% | 5% | 0% | 4% | 0% | 0% | 0% |
Great Barrington | 0% | 0% | 33% | 0% | 0% | 0% | 3% | 0% | 4% | 25% | 5% | 3% | 0% | 0% | 7% | 0% | 0% | 12% | 33% | 12% | 0% | 8% | 5% | 0% | 2% | 4% | 1% | 0% | 0% | 0% | 8% | 0% | 6% | 25% | 2% | 5% | 6% | 4% | 6% | 6% | 0% |
Hancock | 0% | 0% | 0% | 0% | 0% | 0% | 1% | 0% | 3% | 0% | 0% | 3% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 1% | 2% | 0% | 2% | 1% | 1% | 0% | 0% | 0% | 0% | 17% | 1% | 0% | 3% | 7% | 0% | 0% | 0% | 19% | 0% |
Monterey | 0% | 0% | 0% | 0% | 0% | 0% | 2% | 0% | 3% | 0% | 3% | 6% | 0% | 0% | 11% | 0% | 0% | 0% | 0% | 0% | 0% | 4% | 4% | 0% | 1% | 3% | 2% | 25% | 0% | 0% | 11% | 0% | 1% | 0% | 2% | 7% | 38% | 0% | 0% | 6% | 0% |
North Adams | 0% | 100% | 0% | 0% | 100% | 0% | 9% | 0% | 12% | 12% | 6% | 12% | 20% | 0% | 7% | 8% | 0% | 6% | 17% | 12% | 0% | 8% | 4% | 0% | 16% | 7% | 1% | 25% | 0% | 0% | 7% | 0% | 11% | 0% | 8% | 3% | 6% | 12% | 6% | 0% | 0% |
Otis | 0% | 0% | 0% | 100% | 0% | 0% | 2% | 33% | 3% | 0% | 0% | 3% | 0% | 0% | 9% | 8% | 0% | 0% | 0% | 0% | 50% | 13% | 4% | 0% | 0% | 4% | 2% | 0% | 0% | 0% | 9% | 17% | 0% | 0% | 3% | 4% | 0% | 0% | 0% | 0% | 0% |
Peru | 0% | 0% | 0% | 0% | 0% | 0% | 2% | 0% | 3% | 0% | 0% | 6% | 0% | 0% | 4% | 8% | 0% | 6% | 0% | 0% | 0% | 4% | 1% | 0% | 5% | 4% | 0% | 0% | 0% | 33% | 3% | 0% | 1% | 0% | 6% | 4% | 0% | 0% | 0% | 0% | 0% |
Pittsfield East | 9% | 0% | 0% | 0% | 0% | 0% | 14% | 0% | 8% | 0% | 33% | 3% | 0% | 0% | 7% | 0% | 0% | 0% | 17% | 25% | 0% | 3% | 19% | 0% | 19% | 13% | 64% | 0% | 0% | 0% | 14% | 17% | 29% | 0% | 5% | 5% | 0% | 8% | 0% | 0% | 0% |
Pittsfield West | 9% | 0% | 0% | 0% | 0% | 0% | 12% | 33% | 9% | 0% | 17% | 6% | 20% | 0% | 2% | 8% | 0% | 6% | 0% | 12% | 0% | 6% | 17% | 0% | 11% | 6% | 1% | 25% | 0% | 0% | 3% | 17% | 13% | 0% | 10% | 7% | 6% | 29% | 18% | 12% | 0% |
Plainfield | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 3% | 0% | 0% | 0% | 0% | 0% | 0% | 8% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 1% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 3% | 1% | 0% | 0% | 0% | 0% | 0% |
Rowe | 0% | 0% | 0% | 0% | 0% | 20% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 33% | 1% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 3% | 0% | 1% | 1% | 0% | 0% | 0% | 0% | 2% | 17% | 0% | 0% | 5% | 1% | 0% | 0% | 0% | 0% | 0% |
South Sandisfield | 0% | 0% | 0% | 0% | 0% | 0% | 1% | 0% | 6% | 0% | 2% | 3% | 0% | 0% | 6% | 8% | 0% | 12% | 0% | 0% | 0% | 4% | 1% | 0% | 0% | 4% | 1% | 0% | 0% | 0% | 3% | 0% | 0% | 0% | 1% | 4% | 12% | 0% | 0% | 0% | 0% |
Southbury | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 1% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% |
State Line | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 5% | 0% | 0% | 3% | 0% | 0% | 1% | 0% | 0% | 0% | 0% | 0% | 0% | 8% | 2% | 0% | 0% | 4% | 1% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 2% | 2% | 0% | 0% | 0% | 0% | 0% |
Stockbridge | 0% | 0% | 0% | 0% | 0% | 0% | 17% | 0% | 9% | 25% | 5% | 6% | 0% | 33% | 7% | 0% | 0% | 0% | 17% | 12% | 0% | 13% | 7% | 0% | 8% | 11% | 9% | 0% | 0% | 0% | 5% | 0% | 15% | 0% | 8% | 5% | 6% | 17% | 0% | 6% | 100% |
Tolland Center | 0% | 0% | 0% | 0% | 0% | 0% | 1% | 0% | 1% | 0% | 0% | 3% | 0% | 0% | 4% | 0% | 0% | 0% | 0% | 0% | 0% | 3% | 1% | 0% | 0% | 2% | 2% | 0% | 0% | 0% | 3% | 0% | 1% | 0% | 2% | 3% | 0% | 0% | 0% | 0% | 0% |
Williamstown | 27% | 0% | 33% | 0% | 0% | 40% | 9% | 33% | 5% | 12% | 13% | 3% | 20% | 0% | 3% | 8% | 0% | 6% | 17% | 0% | 0% | 1% | 13% | 100% | 15% | 8% | 1% | 25% | 100% | 0% | 4% | 17% | 7% | 50% | 8% | 10% | 6% | 12% | 35% | 25% | 0% |
Windsor | 18% | 0% | 0% | 0% | 0% | 0% | 5% | 0% | 5% | 0% | 4% | 6% | 0% | 0% | 1% | 8% | 0% | 12% | 0% | 25% | 0% | 0% | 2% | 0% | 6% | 4% | 2% | 0% | 0% | 67% | 1% | 0% | 4% | 0% | 5% | 5% | 0% | 4% | 0% | 0% | 0% |
Worthington | 9% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 1% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 1% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 2% | 0% | 0% | 0% | 0% | 0% | 0% |
In dit blog zijn de functies uit het janitor
-pakket beschreven die nuttig zijn voor het dagelijkse werk. Dit is echter geen uitputtende lijst van janitor
functies en ik raad aan om de documentatie te raadplegen voor meer informatie over dit pakket.
Er zijn nog een paar andere functies die op zijn minst de moeite waard zijn om hier te vermelden: excel_numeric_to_date()
: Deze functie is ontworpen om veel van Excel’s datum formaten te verwerken en om deze numerieke variabelen om te zetten naar datum variabelen. Het lijkt een grote tijdsbesparing voor diegenen die vaak met gegevens in Excel werken. Als niet frequent gebruiker van Excel, vertrouw ik in plaats daarvan zwaar op het lubridate
pakket voor het werken met datum variabelen.
round_to_fraction()
: Met deze functie kun je decimale getallen afronden naar een precieze breuknoemer. Wil je al je waarden afgerond hebben naar het dichtstbijzijnde kwartier, of gebruik je decimalen om minuten in een uur weer te geven? Dan kan de round_to_fraction()
-functie jou waarschijnlijk helpen.
top_levels()
: Deze functie genereert een frequentietabel die een categorische variabele samenbrengt in hoge, middelste en lage niveaus. Veelgebruikte gevallen zijn onder andere het vereenvoudigen van Likert-achtige schalen.
Het is op dit punt algemeen bekend dat de meeste dataanalisten en -wetenschappers het grootste deel van hun tijd besteden aan het opschonen en verkennen van gegevens. Daarom is het goed om nieuwe pakketten en functies te ontdekken die deze processen een beetje efficiënter maken.
Of je het janitor
-pakket nu wel of niet eerder hebt gebruikt, ik hoop dat deze blog jouw kennis heeft laten maken met enkele functies die nuttige toevoegingen zullen blijken te zijn aan je datawetenschapsgereedschapskist.