---
title: "Getting Data"
author: "D. Kaplan"
date: "6/1/2019"
output: html_document
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library("readr")
library("dplyr")
library("mosaic")
```

## Which data set do we want?

We talked about it a while. We decided on OSHA.

Any junk at alll d;lkjsd;lkjwer;lkjs


```{r echo=FALSE, message=FALSE, warning = FALSE}
file_name <- "https://www.osha.gov/severeinjury/xml/severeinjury.csv"
OSHA <- readr::read_csv(file_name)
OSHA <- OSHA %>%
  mutate(EventDate = lubridate::dmy(EventDate)) %>%
  mutate(Longitude = - abs(Longitude))
```


Let's look at the range of dates ...

```{r warning=FALSE}
gf_histogram( ~ EventDate, data = OSHA)
```

## Where are the accidents

Let's make a map:

```{r}
gf_point(Latitude ~ Longitude, data = OSHA)
```


```{r}
Foo <- 
  OSHA %>%
  filter(Longitude > -50)
```


## Including Plots

You can also embed plots, for example:

```{r pressure, echo=FALSE}
plot(pressure)
```

Note that the `echo = FALSE` parameter was added to the code chunk to prevent printing of the R code that generated the plot.
