Challenge 1 Instructions

challenge_1
Author

Kim Darkenwald

Published

August 15, 2022

Code
library(tidyverse)


knitr::opts_chunk$set(echo = TRUE, warning=FALSE, message=FALSE)
Code
library(readr)
railroad_2012_clean_county <- read_csv("_data/railroad_2012_clean_county.csv")
View(railroad_2012_clean_county)
Code
dim(railroad_2012_clean_county)
[1] 2930    3
Code
colnames(railroad_2012_clean_county)
[1] "state"           "county"          "total_employees"
Code
select(railroad_2012_clean_county, "state", "county")
# A tibble: 2,930 × 2
   state county              
   <chr> <chr>               
 1 AE    APO                 
 2 AK    ANCHORAGE           
 3 AK    FAIRBANKS NORTH STAR
 4 AK    JUNEAU              
 5 AK    MATANUSKA-SUSITNA   
 6 AK    SITKA               
 7 AK    SKAGWAY MUNICIPALITY
 8 AL    AUTAUGA             
 9 AL    BALDWIN             
10 AL    BARBOUR             
# … with 2,920 more rows
# ℹ Use `print(n = ...)` to see more rows
Code
select(railroad_2012_clean_county, "state", starts_with("M"))
# A tibble: 2,930 × 1
   state
   <chr>
 1 AE   
 2 AK   
 3 AK   
 4 AK   
 5 AK   
 6 AK   
 7 AK   
 8 AL   
 9 AL   
10 AL   
# … with 2,920 more rows
# ℹ Use `print(n = ...)` to see more rows

Describe the data

Found within this dataset are three columns: “state,” “county,” and “total_employees”. There are 2390 rows containing information for these three columns.

Data was collected in the year 2012 determining the amount of railroad employees across the country. According to the data, there are 2930 counties within the country that contain railroad employees. Some states have multiple counties with railroad employees.