Compare commits

..

2 Commits

Author SHA1 Message Date
Nick Hepler
fff48c50bc Merge branch 'master' of https://git.nickhepler.cloud/nick/tree-tracker-report 2025-02-18 21:50:24 -05:00
Nick Hepler
41a2015cbc Adjust R chunk, header 2025-02-18 21:49:29 -05:00

View File

@ -14,7 +14,11 @@ output:
--- ---
```{r setup, include=FALSE} ```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE, message = FALSE, warning = FALSE) knitr::opts_chunk$set(
echo = TRUE,
message = FALSE,
warning = FALSE
)
# Load necessary libraries # Load necessary libraries
library(tidyverse) library(tidyverse)
library(lubridate) library(lubridate)
@ -200,11 +204,11 @@ The plot below visualizes the survey submission trends for the past 90 days. It
The data used for this plot is filtered to include only submissions made in the last 90 days, with the submission count for each date represented by both the line and the points on the graph. A smoothed trend line (dashed) has been added to help visualize the overall submission pattern over this period. The data used for this plot is filtered to include only submissions made in the last 90 days, with the submission count for each date represented by both the line and the points on the graph. A smoothed trend line (dashed) has been added to help visualize the overall submission pattern over this period.
```{r plot-submission-trends-90d, echo=TRUE, message=FALSE} ```{r plot-submission-trends-90d, echo=TRUE, message=FALSE, fig.height=6, fig.width=8}
plot_submission_trends(survey_data, days_ago = 90) plot_submission_trends(survey_data, days_ago = 90)
``` ```
### Response Rates to Top-Level Optional Questions ### Optional Question Response Rates
The table below summarizes the response rates for optional key top-level questions in the survey. These are the questions that all participants are asked, with some triggering additional follow-up questions based on responses. The response rate is the percentage of participants who provided an answer for each question. The table below summarizes the response rates for optional key top-level questions in the survey. These are the questions that all participants are asked, with some triggering additional follow-up questions based on responses. The response rate is the percentage of participants who provided an answer for each question.
The "Total Number of Species Planted" question has special handling—only responses greater than 0 are considered valid, whereas for other questions, any non-NA value counts as a response. The "Total Number of Species Planted" question has special handling—only responses greater than 0 are considered valid, whereas for other questions, any non-NA value counts as a response.
@ -466,7 +470,7 @@ This map displays the **total number of trees planted** across each county in **
The map provides a visual overview of tree planting distribution across New York, making it easier to identify areas with the highest impact or need for further action. The map provides a visual overview of tree planting distribution across New York, making it easier to identify areas with the highest impact or need for further action.
```{r create-county-choropleth-map, echo=TRUE, message=FALSE} ```{r create-county-choropleth-map, echo=TRUE, message=FALSE, fig.height=6, fig.width=8}
library(tigris) # For geographic data library(tigris) # For geographic data
library(sf) # For handling spatial data library(sf) # For handling spatial data
library(dplyr) # For data manipulation library(dplyr) # For data manipulation
@ -497,6 +501,10 @@ ggplot(data = ny_counties_merged) +
``` ```
```{r create-summary-table-county, echo=TRUE, message=FALSE}
create_summary_table(survey_data, "County")
```
## Tree Analysis {.tabset} ## Tree Analysis {.tabset}
```{r func-create_species_summary_table, echo=TRUE} ```{r func-create_species_summary_table, echo=TRUE}
create_species_summary_table <- function(data, field, field_label = NULL) { create_species_summary_table <- function(data, field, field_label = NULL) {