MADT_Homework 2

This is homework 2 for DACSS601

Meredith Derian-Toth
2/8/2022

R Markdown

setwd("~/Desktop/dacss 601/R Data")
library(readr)
rr_data <- read_csv("railroad_2012_clean_county_tidy.csv")
View(rr_data)

#The variables in my dataset are state, county, and total_employees. #state and countar are both categorial, nominal variables. #total_employees is an integar, and a discrete variable. The value is the count of railroad employees within in specific state and county.

library(dplyr)
data(rr_data)
  rr_data%>%
  filter(state=="AL")%>%
  arrange(desc(total_employees))
# A tibble: 67 × 3
   state county    total_employees
   <chr> <chr>               <dbl>
 1 AL    JEFFERSON             990
 2 AL    MOBILE                331
 3 AL    COLBERT               199
 4 AL    WALKER                192
 5 AL    ST CLAIR              162
 6 AL    SHELBY                158
 7 AL    BLOUNT                154
 8 AL    BALDWIN               143
 9 AL    CULLMAN               129
10 AL    DALLAS                122
# … with 57 more rows
rr_data_AL <- data(rr_data)
  rr_data%>%
  filter(state=="AL")%>%
  arrange(desc(total_employees))
# A tibble: 67 × 3
   state county    total_employees
   <chr> <chr>               <dbl>
 1 AL    JEFFERSON             990
 2 AL    MOBILE                331
 3 AL    COLBERT               199
 4 AL    WALKER                192
 5 AL    ST CLAIR              162
 6 AL    SHELBY                158
 7 AL    BLOUNT                154
 8 AL    BALDWIN               143
 9 AL    CULLMAN               129
10 AL    DALLAS                122
# … with 57 more rows
rr_data_AK <-rr_data%>%
select(`state`,`total_employees`)%>%
filter(state=="AK")

rr_data_AK%>%
arrange(desc(total_employees))
# A tibble: 6 × 2
  state total_employees
  <chr>           <dbl>
1 AK                 88
2 AK                  7
3 AK                  3
4 AK                  2
5 AK                  2
6 AK                  1

Reuse

Text and figures are licensed under Creative Commons Attribution CC BY-NC 4.0. The figures that have been reused from other sources don't fall under this license and can be recognized by a note in their caption: "Figure from ...".

Citation

For attribution, please cite this work as

Derian-Toth (2022, Feb. 23). Data Analytics and Computational Social Science: MADT_Homework 2. Retrieved from https://github.com/DACSS/dacss_course_website/posts/httpsrpubscommderiantothdacsshw2mdt/

BibTeX citation

@misc{derian-toth2022madt_homework,
  author = {Derian-Toth, Meredith},
  title = {Data Analytics and Computational Social Science: MADT_Homework 2},
  url = {https://github.com/DACSS/dacss_course_website/posts/httpsrpubscommderiantothdacsshw2mdt/},
  year = {2022}
}