Challenge 1 Instructions

challenge_1
Author

Yakub Rabiutheen

Published

August 15, 2022

Code
library(tidyverse)

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

Challenge Overview

Today’s challenge is to

  1. read in a dataset, and

  2. describe the dataset using both words and any supporting information (e.g., tables, etc)

Read in the Data

Read in one (or more) of the following data sets, using the correct R package and command.

  • railroad_2012_clean_county.csv ⭐
  • birds.csv ⭐⭐
  • FAOstat*.csv ⭐⭐
  • wild_bird_data.xlsx ⭐⭐⭐
  • StateCounty2012.xlsx ⭐⭐⭐⭐

Find the _data folder, located inside the posts folder. Then you can read in the data, using either one of the readr standard tidy read commands, or a specialized package such as readxl.

Code
library(readxl)

Add any comments or documentation as needed. More challenging data sets may require additional code chunks and documentation.

Describe the data

Using a combination of words and results of R commands, can you provide a high level description of the data? Describe as efficiently as possible where/how the data was (likely) gathered, indicate the cases and variables (both the interpretation and any details you deem useful to the reader to fully understand your chosen data).

Code
statevcounty <- read_xls("_data/StateCounty2012.xls", skip = 2)
Code
head(statevcounty)
# A tibble: 6 × 5
  STATE     ...2  COUNTY               ...4  TOTAL
  <chr>     <lgl> <chr>                <lgl> <dbl>
1 AE        NA    APO                  NA        2
2 AE Total1 NA    <NA>                 NA        2
3 AK        NA    ANCHORAGE            NA        7
4 AK        NA    FAIRBANKS NORTH STAR NA        2
5 AK        NA    JUNEAU               NA        3
6 AK        NA    MATANUSKA-SUSITNA    NA        2
Code
glimpse(statevcounty)
Rows: 2,990
Columns: 5
$ STATE  <chr> "AE", "AE Total1", "AK", "AK", "AK", "AK", "AK", "AK", "AK Tota…
$ ...2   <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
$ COUNTY <chr> "APO", NA, "ANCHORAGE", "FAIRBANKS NORTH STAR", "JUNEAU", "MATA…
$ ...4   <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
$ TOTAL  <dbl> 2, 2, 7, 2, 3, 2, 1, 88, 103, 102, 143, 1, 25, 154, 13, 29, 45,…

Picked Relevant Columns

Code
statevcounty <- statevcounty %>% select(STATE,COUNTY,TOTAL)