Challenge 1 Instructions

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

Asritha Reddy Gade

Published

June 1, 2023

Code
library(tidyverse)
library(readxl)

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.xls ⭐⭐⭐⭐

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
#reading and showing the birds.csv file.
birds <- readr::read_csv("_data/birds.csv")
birds
# A tibble: 30,977 × 14
   `Domain Code` Domain     `Area Code` Area  `Element Code` Element `Item Code`
   <chr>         <chr>            <dbl> <chr>          <dbl> <chr>         <dbl>
 1 QA            Live Anim…           2 Afgh…           5112 Stocks         1057
 2 QA            Live Anim…           2 Afgh…           5112 Stocks         1057
 3 QA            Live Anim…           2 Afgh…           5112 Stocks         1057
 4 QA            Live Anim…           2 Afgh…           5112 Stocks         1057
 5 QA            Live Anim…           2 Afgh…           5112 Stocks         1057
 6 QA            Live Anim…           2 Afgh…           5112 Stocks         1057
 7 QA            Live Anim…           2 Afgh…           5112 Stocks         1057
 8 QA            Live Anim…           2 Afgh…           5112 Stocks         1057
 9 QA            Live Anim…           2 Afgh…           5112 Stocks         1057
10 QA            Live Anim…           2 Afgh…           5112 Stocks         1057
# ℹ 30,967 more rows
# ℹ 7 more variables: Item <chr>, `Year Code` <dbl>, Year <dbl>, Unit <chr>,
#   Value <dbl>, Flag <chr>, `Flag Description` <chr>
Code
# reading and printing the first 6 rows of StateCounty2012.xls file.
statecounty <- readxl::read_excel("_data/StateCounty2012.xls")
head(statecounty)
# A tibble: 6 × 6
  `TOTAL RAILROAD EMPLOYMENT BY STATE AND COUNTY` ...2   ...3  ...4  ...5  ...6 
  <chr>                                           <chr>  <lgl> <chr> <lgl> <chr>
1 CALENDAR YEAR 2012                              <NA>   NA    <NA>  NA    <NA> 
2 <NA>                                            <NA>   NA    <NA>  NA    <NA> 
3 <NA>                                            STATE  NA    COUN… NA    TOTAL
4 <NA>                                            AE     NA    APO   NA    2    
5 <NA>                                            AE To… NA    <NA>  NA    2    
6 <NA>                                            AK     NA    ANCH… NA    7    

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).

The birds file show some information of where and how the birds are stored like the area and element.The statecounty file gives data by state and county about the railroad employment.