Challenge 1 Solution

challenge_1
railroads
faostat
wildbirds
Susannah Reed Poland
Reading in data and creating a post
Author

Susannah Reed Poland

Published

June 6, 2023

Code
library(tidyverse)

knitr::opts_chunk$set(echo = TRUE, warning=FALSE, message=FALSE)

Challenge Overview

Today I have read in a dataset and described it.

Read in the Data

I read in the following dataset: railroad_2012_clean_county.csv ⭐

Code
read_csv("_data/railroad_2012_clean_county.csv")
Code
railroad<-read_csv("_data/railroad_2012_clean_county.csv")
railroad

Describe the data

This dataframe seems to contain 3 variables (State, County, and Total Employees) and 2930 observations. Inferring from the title of the table, it seems that this table is showing us the number of people working for the railroad in each county in 2012.

Code
railroad%>%
  select(state)%>%
  n_distinct()
[1] 53

There are 53 unique “States” in the table, and I would presume that this count includes some territories, districts, or areas that are not official U.S. states. Here is a list of the distinct states:

Code
railroad%>%
  select(state)%>%
  distinct()

A quick scan of this list reveals that ‘DC’ is included, which I presume to be the District of Columbia plus others perhaps including Puerto Rico, etc.