Browse Source

data/ex

master
boB Rudis 5 years ago
parent
commit
6bc3443f95
No known key found for this signature in database GPG Key ID: 1D7529BE14E2BBA9
  1. 21
      LICENSE
  2. 90
      README.Rmd
  3. 139
      README.md
  4. BIN
      README_files/figure-gfm/points-map-1.png
  5. BIN
      data/lowes-stores-geo.csv.gz

21
LICENSE

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2019 Bob Rudis <bob@rud.is>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

90
README.Rmd

@ -1,7 +1,7 @@
---
output: rmarkdown::github_document
editor_options:
chunk_output_type: inline
chunk_output_type: console
---
```{r pkg-knitr-opts, include=FALSE}
knitr::opts_chunk$set(
@ -12,3 +12,91 @@ options(width=120)
# loweslocations
This past week [Lowe's told their assemblers they were all out of a job](https://www.wsj.com/articles/lowes-lays-off-thousands-of-store-workers-11564680676). This decision impacts ~1-3 (sometimes more depending on the store) workers per [Lowe's store](https://www.lowes.com/Lowes-Stores) and Lowe's assemblers used to make between ~\$13.00 & \$18.00 USD/hour.
The `data` directory contains [`lowes-stores-geo.csv.gz`](data/lowes-stores-geo.csv.gz) which is lovingly hand-crafted transcription of all the locations listed at <https://www.lowes.com/Lowes-Stores>. The addresses have been geolocated (using [{rgeocodio}](https://git.rud.is/hrbrmstr/rgeocodio)) and contain:
- store name
- store published address
- store geocoded legit address
- store phone #
- county
- city
- state
- longitude
- latitude
which should be sufficient to enable data journalists to cross reference with census/economic data to facilitate potential regional impact reporting.
## Some Summary Info
```{r libs}
library(sf)
library(albersusa)
library(hrbrthemes)
library(tidyverse)
```
```{r data}
cols(
o_addr = col_character(),
fmt_addr = col_character(),
phone = col_character(),
city = col_character(),
county = col_character(),
state = col_character(),
lat = col_double(),
lng = col_double()
) -> lowes_cols
lowes <- read_csv(here::here("data/lowes-stores-geo.csv.gz"), col_types = lowes_cols)
```
```{r show-data}
head(lowes) %>%
knitr::kable("markdown")
```
```{r move-points}
filter(lowes, !(state %in% c("HI", "AK"))) %>%
select(lon=lng, lat) %>%
bind_rows(
filter(lowes, (state %in% c("HI", "AK"))) %>%
select(lng, lat) %>%
points_elided(.) %>%
select(lon=1, lat=2)
) %>%
st_as_sf(
coords = c("lon", "lat"),
crs = us_longlat_proj,
agr = "constant"
) -> pts
```
```{r points-map, fig.width=1000/72, fig.height=500/72}
ggplot() +
geom_sf(data = usa_sf("longlat"), fill = ft_cols$gray) +
geom_sf(data = pts, size = 0.5, alpha = 1/2, color = ft_cols$yellow) +
coord_sf(crs = us_laea_proj, datum = NA) +
labs(
x = NULL, y = NULL,
title = "Lowe's Locations"
) +
theme_ft_rc(grid="") +
theme(axis.text = element_blank())
```
```{r city-sum}
count(lowes, state, sort=TRUE) %>%
top_n(10) %>%
knitr::kable()
```
```{r county-sum}
count(lowes, county, state, sort=TRUE) %>%
top_n(10) %>%
knitr::kable()
```

139
README.md

@ -0,0 +1,139 @@
# loweslocations
This past week [Lowe’s told their assemblers they were all out of a
job](https://www.wsj.com/articles/lowes-lays-off-thousands-of-store-workers-11564680676).
This decision impacts \~1-3 (sometimes more depending on the store)
workers per [Lowe’s store](https://www.lowes.com/Lowes-Stores) and
Lowe’s assemblers used to make between \~$13.00 & $18.00 USD/hour.
The `data` directory contains
[`lowes-stores-geo.csv.gz`](data/lowes-stores-geo.csv.gz) which is
lovingly hand-crafted transcription of all the locations listed at
<https://www.lowes.com/Lowes-Stores>. The addresses have been geolocated
(using [{rgeocodio}](https://git.rud.is/hrbrmstr/rgeocodio)) and
contain:
- store name
- store published address
- store geocoded legit address
- store phone \#
- county
- city
- state
- longitude
- latitude
which should be sufficient to enable data journalists to cross reference
with census/economic data to facilitate potential regional impact
reporting.
## Some Summary Info
``` r
library(sf)
library(albersusa)
library(hrbrthemes)
library(tidyverse)
```
``` r
cols(
o_addr = col_character(),
fmt_addr = col_character(),
phone = col_character(),
city = col_character(),
county = col_character(),
state = col_character(),
lat = col_double(),
lng = col_double()
) -> lowes_cols
lowes <- read_csv(here::here("data/lowes-stores-geo.csv.gz"), col_types = lowes_cols)
```
``` r
head(lowes) %>%
knitr::kable("markdown")
```
| o\_addr | fmt\_addr | phone | city | county | state | lat | lng |
| :------------------------------------- | :----------------------------------------------- | :------------- | :-------- | :--------------------------- | :---- | -------: | ----------: |
| 333 East Tudor Rd , AK 99503 | 333 E Tudor Rd, Anchorage, AK 99503 | (907) 563-0391 | Anchorage | Anchorage Municipality | AK | 61.18100 | \-149.87856 |
| 1200 North Muldoon , AK 99504 | 1200 N Muldoon Rd, Anchorage, AK 99504 | (907) 269-2400 | Anchorage | Anchorage Municipality | AK | 61.22563 | \-149.74607 |
| 10900 Old Seward Highway , AK 99515 | 10900 Old Seward Hwy, Anchorage, AK 99515 | (907) 349-8889 | Anchorage | Anchorage Municipality | AK | 61.12179 | \-149.86645 |
| 425 Merhar Ave , AK 99701 | 425 Merhar Ave, Fairbanks, AK 99701 | (907) 451-4700 | Fairbanks | Fairbanks North Star Borough | AK | 64.85682 | \-147.69653 |
| 2561 East Sun Mountain Ave , AK 99654 | 2561 E Sun Mountain Ave, Wasilla, AK 99654 | (907) 352-3100 | Wasilla | Matanuska-Susitna Borough | AK | 61.57333 | \-149.38457 |
| 235 Colonial Promenade Pkwy , AL 35007 | 235 Colonial Promenade Pkwy, Alabaster, AL 35007 | (205) 685-4060 | Alabaster | Shelby County | AL | 33.23110 | \-86.80503 |
``` r
filter(lowes, !(state %in% c("HI", "AK"))) %>%
select(lon=lng, lat) %>%
bind_rows(
filter(lowes, (state %in% c("HI", "AK"))) %>%
select(lng, lat) %>%
points_elided(.) %>%
select(lon=1, lat=2)
) %>%
st_as_sf(
coords = c("lon", "lat"),
crs = us_longlat_proj,
agr = "constant"
) -> pts
```
``` r
ggplot() +
geom_sf(data = usa_sf("longlat"), fill = ft_cols$gray) +
geom_sf(data = pts, size = 0.5, alpha = 1/2, color = ft_cols$yellow) +
coord_sf(crs = us_laea_proj, datum = NA) +
labs(
x = NULL, y = NULL,
title = "Lowe's Locations"
) +
theme_ft_rc(grid="") +
theme(axis.text = element_blank())
```
<img src="README_files/figure-gfm/points-map-1.png" width="1333.33333333333" />
``` r
count(lowes, state, sort=TRUE) %>%
top_n(10) %>%
knitr::kable()
```
| state | n |
| :---- | --: |
| TX | 142 |
| FL | 126 |
| NC | 114 |
| CA | 110 |
| OH | 83 |
| PA | 83 |
| NY | 70 |
| VA | 69 |
| GA | 63 |
| TN | 60 |
``` r
count(lowes, county, state, sort=TRUE) %>%
top_n(10) %>%
knitr::kable()
```
| county | state | n |
| :-------------------- | :---- | -: |
| Maricopa County | AZ | 21 |
| Los Angeles County | CA | 20 |
| Harris County | TX | 18 |
| Clark County | NV | 13 |
| Riverside County | CA | 12 |
| Tarrant County | TX | 11 |
| Bexar County | TX | 10 |
| San Bernardino County | CA | 10 |
| Allegheny County | PA | 9 |
| Dallas County | TX | 9 |
| Franklin County | OH | 9 |
| Hillsborough County | FL | 9 |
| Mecklenburg County | NC | 9 |

BIN
README_files/figure-gfm/points-map-1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 492 KiB

BIN
data/lowes-stores-geo.csv.gz

Binary file not shown.
Loading…
Cancel
Save