Skip to content

Commit

Permalink
new render
Browse files Browse the repository at this point in the history
  • Loading branch information
ttuff committed Apr 30, 2024
1 parent 9927d9a commit c209fd6
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 49 deletions.
Binary file modified docs/worksheets/Crime_word_cloud_per_grade.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/worksheets/HOLC_grades_individually.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/worksheets/crime.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/worksheets/crime_density_plot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/worksheets/ndvi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 12 additions & 20 deletions docs/worksheets/worksheet_redlining.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ get_city_state_list_from_redlining_data <- function() {
```

</details>
<details open>
<details>
<summary>
Stream list of available HOLC cities
</summary>
Expand Down Expand Up @@ -498,7 +498,7 @@ load_city_redlining_data <- function(city_name) {
```

</details>
<details open>
<details>
<summary>
Stream HOLC data for Denver, CO
</summary>
Expand Down Expand Up @@ -828,13 +828,7 @@ knitr::kable(denver_redlining, format = "markdown")
| 11171 | Denver | CO | TRUE | Industrial | NA | Industrial | FALSE | FALSE | TRUE | \#000000 | 08031000702 | G0800310000702 | 8.928204e+02 | 0.00063 | MULTIPOLYGON (((-105.0252 3… |
| 11171 | Denver | CO | TRUE | Industrial | NA | Industrial | FALSE | FALSE | TRUE | \#000000 | 08031002100 | G0800310002100 | 1.173355e+06 | 0.30411 | MULTIPOLYGON (((-104.992 39… |

![](worksheet_redlining_files/figure-gfm/unnamed-chunk-6-1.png)

</details>

![Styled Table](../docs/worksheets/table.html) ![Styled
Table](../docs/worksheets/table.png)

<details>
<summary>
FUNCTION: Get Points-of-Interest from city of interest
Expand Down Expand Up @@ -976,7 +970,7 @@ get_places <- function(polygon_layer, type = "food" ) {
</details>
<details>
<summary>
FUNCTION: Plot POI with HOLC
FUNCTION: Plot POI over HOLC grades
</summary>

``` r
Expand Down Expand Up @@ -1019,7 +1013,7 @@ plot_city_redlining <- function(redlining_data, filename = "redlining_plot.png")
```

</details>
<details open>
<details>
<summary>
Plot Denver Redlining
</summary>
Expand Down Expand Up @@ -1056,7 +1050,7 @@ government_buildings <- get_places(denver_redlining, type="government_buildings"
</details>
<details>
<summary>
FUNCTION: Plot the 4 HOLC grades individually
FUNCTION: Plot the HOLC grades individually
</summary>

``` r
Expand Down Expand Up @@ -1087,6 +1081,7 @@ split_plot <- function(sf_data, roads, rivers) {
panel.grid.major = element_blank(), # Remove major grid lines
panel.grid.minor = element_blank())

ggsave(plot, filename = "HOLC_grades_individually.png", width = 10, height = 6, units = "in", dpi = 1200)
return(plot)
}
```
Expand All @@ -1099,12 +1094,12 @@ Plot 4 HOLC grades individually

``` r
plot_row <- split_plot(denver_redlining, roads, rivers)
print(plot_row)
```

![](worksheet_redlining_files/figure-gfm/unnamed-chunk-12-1.png)

</details>

![](../worksheets/HOLC_grades_individually.png)

<details>
<summary>
FUNCTION: Map an amenity over each grade individually
Expand Down Expand Up @@ -1244,7 +1239,7 @@ Map food over each grade individually
print(food_match$plot)
```

![](worksheet_redlining_files/figure-gfm/unnamed-chunk-15-1.png)
![](worksheet_redlining_files/figure-gfm/unnamed-chunk-14-1.png)

</details>
<details>
Expand Down Expand Up @@ -1283,7 +1278,7 @@ Map processed food over each grade individually
print(processed_food_match$plot)
```

![](worksheet_redlining_files/figure-gfm/unnamed-chunk-17-1.png)
![](worksheet_redlining_files/figure-gfm/unnamed-chunk-16-1.png)

</details>
<details>
Expand All @@ -1309,7 +1304,7 @@ Map natural habitats over each grade individually
print(natural_habitats_match$plot)
```

![](worksheet_redlining_files/figure-gfm/unnamed-chunk-19-1.png)
![](worksheet_redlining_files/figure-gfm/unnamed-chunk-18-1.png)

</details>

Expand Down Expand Up @@ -1687,9 +1682,6 @@ result <- process_city_inventory_data(
)
```

Warning: `stat(density)` was deprecated in ggplot2 3.4.0.
ℹ Please use `after_stat(density)` instead.

</details>

![](../worksheets/Denver_traffic_accidents.png)
Expand Down
38 changes: 9 additions & 29 deletions docs/worksheets/worksheet_redlining.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ get_city_state_list_from_redlining_data <- function() {



<details open>
<details>
<summary>Stream list of available HOLC cities</summary>
```{r, cache=TRUE, warning=FALSE, message=FALSE}
#Retrieve the list of cities and states
Expand Down Expand Up @@ -134,37 +134,16 @@ load_city_redlining_data <- function(city_name) {



<details open>
<details>
<summary>Stream HOLC data for Denver, CO</summary>
```{r, cache=TRUE, warning=FALSE, message=FALSE}
# Load redlining data for Denver
denver_redlining <- load_city_redlining_data("Denver")
knitr::kable(denver_redlining, format = "markdown")
```
```{r, echo=FALSE, cache=TRUE}
library(knitr)
library(kableExtra)
kable_output <- kable(head(denver_redlining), format = "html", table.attr = "style='width:100%'") %>%
kable_styling(bootstrap_options = c("striped", "hover"))
# Save the HTML table to a file
html_file <- "table.html"
writeLines(as.character(kable_output), con = html_file)
# Use webshot to take a screenshot of the HTML file
image_file <- "table.png"
webshot2::webshot(url = html_file, file = image_file, vwidth = 1000, vheight = 500)
```

</details>

![Styled Table](../docs/worksheets/table.html)
![Styled Table](../docs/worksheets/table.png)


<details>
<summary>FUNCTION: Get Points-of-Interest from city of interest</summary>
Expand Down Expand Up @@ -306,7 +285,7 @@ get_places <- function(polygon_layer, type = "food" ) {
</details>

<details>
<summary>FUNCTION: Plot POI with HOLC </summary>
<summary>FUNCTION: Plot POI over HOLC grades </summary>
```{r, warning=FALSE, collapse=TRUE}
Expand Down Expand Up @@ -352,7 +331,7 @@ plot_city_redlining <- function(redlining_data, filename = "redlining_plot.png")
</details>


<details open>
<details>
<summary>Plot Denver Redlining</summary>
```{r, cache=TRUE, warning=FALSE, message=FALSE}
denver_plot <- plot_city_redlining(denver_redlining)
Expand Down Expand Up @@ -384,7 +363,7 @@ government_buildings <- get_places(denver_redlining, type="government_buildings"


<details>
<summary>FUNCTION: Plot the 4 HOLC grades individually</summary>
<summary>FUNCTION: Plot the HOLC grades individually</summary>
```{r, collapse=TRUE}
split_plot <- function(sf_data, roads, rivers) {
# Filter for grades A, B, C, and D
Expand Down Expand Up @@ -413,6 +392,7 @@ split_plot <- function(sf_data, roads, rivers) {
panel.grid.major = element_blank(), # Remove major grid lines
panel.grid.minor = element_blank())
ggsave(plot, filename = "HOLC_grades_individually.png", width = 10, height = 6, units = "in", dpi = 1200)
return(plot)
}
```
Expand All @@ -423,10 +403,10 @@ split_plot <- function(sf_data, roads, rivers) {
<summary>Plot 4 HOLC grades individually</summary>
```{r, cache=TRUE, warning=FALSE, message=FALSE}
plot_row <- split_plot(denver_redlining, roads, rivers)
print(plot_row)
```
</details>

![](../worksheets/HOLC_grades_individually.png)

<details>
<summary>FUNCTION: Map an amenity over each grade individually</summary>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c209fd6

Please sign in to comment.