Code
library(tidyverse)
library(readxl)
::opts_chunk$set(echo = TRUE, warning=FALSE, message=FALSE) knitr
Jerin Jacob
December 12, 2022
This is a data set of the rail road employees working in 2930 counties of the states in US in the year of 2012. There are 3 variables in the dataset; state, county and total number of employees.
[1] 53
# A tibble: 53 × 1
state
<chr>
1 AE
2 AK
3 AL
4 AP
5 AR
6 AZ
7 CA
8 CO
9 CT
10 DC
# … with 43 more rows
There are 53 distinct values in the variable column named state. This means that there are certain additional values other than the name of the states. The variable ‘state’ contains all the states along with armed forces, DC etc. To find what values are included other than the name of the states, the distinct values of the variable ‘state’ is taken.
---
title: "Challenge 1"
author: "Jerin Jacob"
description: "Reading in data and creating a post"
date: "12/12/2022"
format:
html:
toc: true
code-fold: true
code-copy: true
code-tools: true
categories:
- challenge_1
---
```{r}
#| label: setup
#| warning: false
#| message: false
library(tidyverse)
library(readxl)
knitr::opts_chunk$set(echo = TRUE, warning=FALSE, message=FALSE)
```
## Reading Railroad Employees Dataset
```{r}
library(haven)
library(readr)
railroad <- read_csv("_data/railroad_2012_clean_county.csv")
```
This is a data set of the rail road employees working in 2930 counties of the states in US in the year of 2012.
There are 3 variables in the dataset; state, county and total number of employees.
## Describing Railroad Data
```{r}
view(railroad)
railroad%>%
select(state)%>%
n_distinct(.)
railroad%>%
select(state)%>%
distinct()
```
There are 53 distinct values in the variable column named state. This means that there are certain additional values other than the name of the states. The variable 'state' contains all the states along with armed forces, DC etc. To find what values are included other than the name of the states, the distinct values of the variable 'state' is taken.