commit
f5897c8b4c
15
.gitignore
vendored
15
.gitignore
vendored
@ -1,8 +1,19 @@
|
||||
.Rproj*
|
||||
|
||||
data/addresses/*
|
||||
api_keys/*
|
||||
figures/*
|
||||
|
||||
.Rhistory
|
||||
.Rproj.user
|
||||
*.md
|
||||
.DS_Store
|
||||
!README.md
|
||||
.Rhistory
|
||||
*\.\#*
|
||||
data
|
||||
!data/
|
||||
.RData
|
||||
data-bkup/
|
||||
data-bkup
|
||||
*.R
|
||||
*.bak
|
||||
archive/
|
||||
|
15
Makefile
Normal file
15
Makefile
Normal file
@ -0,0 +1,15 @@
|
||||
route_analysis: R/route_analysis.Rmd
|
||||
R -e 'library("rmarkdown"); old_path <- Sys.getenv("PATH"); Sys.setenv(PATH = paste(old_path, "/usr/local/bin", sep = ":")); rmarkdown::render(knit_root_dir = "~/route_analysis/", output_dir = "~/route_analysis/html", input = "./R/route_analysis.Rmd", output_file = "./html/route_analysis.html")'
|
||||
|
||||
clean: clean-data clean-figure clean-script
|
||||
|
||||
clean-data:
|
||||
rm -vf ./R/data/*.rds
|
||||
|
||||
clean-script:
|
||||
rm -rvf ./*.md
|
||||
|
||||
clean-figure:
|
||||
rm -rvf ./figure/
|
||||
|
||||
.PHONY: data
|
@ -1,3 +1,17 @@
|
||||
---
|
||||
title: "Route Analysis"
|
||||
output:
|
||||
html_document:
|
||||
toc: true
|
||||
toc_depth: 5
|
||||
toc_float:
|
||||
collapsed: false
|
||||
smooth_scroll: true
|
||||
---
|
||||
|
||||
```{r libs, eval = TRUE, echo = TRUE, results = "show", warning = FALSE, error = TRUE, message = FALSE}
|
||||
date()
|
||||
rm(list=ls())
|
||||
library(tidyverse)
|
||||
library(ggmap)
|
||||
library(sf)
|
||||
@ -5,8 +19,13 @@ library(osrm)
|
||||
library(smoothr)
|
||||
library(magick)
|
||||
library(ggnewscale)
|
||||
fig.height <- 6
|
||||
set.seed(1)
|
||||
```
|
||||
|
||||
# Main R script
|
||||
|
||||
```{r Rscript, eval = FALSE, echo = TRUE, results = "show", warning = FALSE, error = FALSE, message = FALSE}
|
||||
## school focus
|
||||
school_focus <- data.frame(name = c("East High School"), NCES_CODE = c("550852000925"))
|
||||
|
||||
@ -217,3 +236,13 @@ ggsave(file = paste0("figures/",
|
||||
width = 11,
|
||||
units = "in",
|
||||
create.dir = TRUE)
|
||||
|
||||
|
||||
```
|
||||
|
||||
# Appendix
|
||||
|
||||
```{r chunklast, eval = TRUE, echo = TRUE, results = "show", warning = TRUE, error = TRUE, message = TRUE}
|
||||
date()
|
||||
sessionInfo()
|
||||
```
|
@ -15,3 +15,7 @@ This script will generate a few figures:
|
||||
|
||||
### A map of those routes colored by the level of traffic stress to bike
|
||||

|
||||
|
||||
## Using make
|
||||
The command `make route_analysis` will run *route_analysis.Rmd* which
|
||||
is an R markdown file containing the original R script *route_analysis.R*
|
||||
|
4
html/.gitignore
vendored
Normal file
4
html/.gitignore
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
# Ignore everything in this directory
|
||||
*
|
||||
# Except this file
|
||||
!.gitignore
|
Loading…
x
Reference in New Issue
Block a user