DACSS 601: Data Science Fundamentals - FALL 2022
  • Fall 2022 Posts
  • Contributors
  • DACSS

Challenge 1 Instructions

  • Course information
    • Overview
    • Instructional Team
    • Course Schedule
  • Weekly materials
    • Fall 2022 posts
    • final posts

On this page

  • Challenge Overview
  • Read in the Data
  • Railroad Data
  • Birds Data
  • Wild Birds Data
  • State County 2012 Data
  • Describe the data
  • Connor’s Answer to Describing the Data

Challenge 1 Instructions

  • Show All Code
  • Hide All Code

  • View Source
challenge_1
railroads
faostat
wildbirds
Author

Connor Skowyra

Published

September 22, 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.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.

Railroad Data

library(readr) railroad_2012_clean_county <- read_csv(“posts/_data/railroad_2012_clean_county.csv”)

Birds Data

library(readr) birds.csv <- read_csv(“posts/_data/birds.csv”)

##FAOSTAT Data

library(readr) FAOSTAT_cattle_dairy.csv <- read_csv(“posts/_data/FAOSTAT_cattle_dairy.csv”)

library(readr) FAOSTAT_country_groups.csv <- read_csv(“posts/_data/FAOSTAT_country_groups.csv”)

library(readr) FAOSTAT_egg_chicken.csv <- read_csv(“posts/_data/FAOSTAT_egg_chicken.csv”)

library(readr) FAOSTAT_livestock.csv <- read_csv(“posts/_data/FAOSTAT_livestock.csv”)

Wild Birds Data

library(readxl) wild_bird_data <- read_excel(“posts/_data/wild_bird_data.xlsx”) View(wild_bird_data)

State County 2012 Data

library(readxl) StateCounty2012<-read_excel(“posts/_data/StateCounty2012.xls”)

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

Connor’s Answer to Describing the Data

The data for all sets were either created in Excel or a plain text format called CSV (Comma Separated Values). To fully understand the datasets, first, we can make it easier by selecting specific columns using select().

An example is: select(railroad_2012_clean_county, contains(“state”))

To make it easier to view the StateCounty2012 dataset, we can rename column …2 to State to understand what values being looked at.

## Rename …2 to State

State <- select(StateCounty2012,…2)

Once we rename our column, we will make a table to interpret our data.

## Make Table of State

table(State)

This table will summarize the amount of workers on the railroad per county in 2012.

Source Code
---
title: "Challenge 1 Instructions"
author: "Connor Skowyra"
desription: "Reading in data and creating a post"
date: "09/22/2022"
format:
  html:
    toc: true
    code-fold: true
    code-copy: true
    code-tools: true
categories:
  - challenge_1
  - railroads
  - faostat
  - wildbirds
---

```{r}
#| label: setup
#| warning: false
#| message: false

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

## Railroad Data

> library(readr)
> railroad_2012_clean_county <- read_csv("posts/_data/railroad_2012_clean_county.csv")

## Birds Data

> library(readr)
> birds.csv <- read_csv("posts/_data/birds.csv")

##FAOSTAT Data

> library(readr)
> FAOSTAT_cattle_dairy.csv <- read_csv("posts/_data/FAOSTAT_cattle_dairy.csv")

> library(readr)
> FAOSTAT_country_groups.csv <- read_csv("posts/_data/FAOSTAT_country_groups.csv")

> library(readr)
> FAOSTAT_egg_chicken.csv <- read_csv("posts/_data/FAOSTAT_egg_chicken.csv")

> library(readr)
> FAOSTAT_livestock.csv <- read_csv("posts/_data/FAOSTAT_livestock.csv")

## Wild Birds Data

> library(readxl)
> wild_bird_data <- read_excel("posts/_data/wild_bird_data.xlsx")
> View(wild_bird_data)

## State County 2012 Data

> library(readxl)
> StateCounty2012<-read_excel("posts/_data/StateCounty2012.xls")

```{r}
```

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

## Connor's Answer to Describing the Data

The data for all sets were either created in Excel or a plain text format called CSV (Comma Separated Values). To fully understand the datasets, first, we can make it easier by selecting specific columns using select().

An example is: select(railroad_2012_clean_county, contains("state"))

To make it easier to view the StateCounty2012 dataset, we can rename column ...2 to State to understand what values being looked at.

  ## Rename ...2 to State
  
State <- select(StateCounty2012,...2)

Once we rename our column, we will make a table to interpret our data.

  ## Make Table of State

table(State)

This table will summarize the amount of workers on the railroad per county in 2012.

```{r}
#| label: summary

```