-
Notifications
You must be signed in to change notification settings - Fork 0
/
01_rmarkdown_static.Rmd
61 lines (41 loc) · 1.44 KB
/
01_rmarkdown_static.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
---
title: "HTS Households (static)"
author: "Matt Landis"
date: "11/23/2020"
output:
html_document:
code_folding: show
editor_options:
chunk_output_type: console
---
```{r setup}
# Set options
knitr::opts_chunk$set(echo = TRUE, comment = '')
suppressPackageStartupMessages({
library(data.table)
library(ggplot2)
})
# Load data
hh_labeled = readRDS('data/tnc_bayarea_hh_labeled.rds')
hh_map = hh_labeled[
!income_aggregate %in% c('Prefer not to answer', 'Missing: Non-response', 'Missing: Skip logic') & !is.na(income_aggregate)]
hh_table = hh_labeled[, .(hh_id, num_people, income_aggregate, rent_own, res_type)]
```
## Including R code
You can include a "chunk" of R code and it will be replaced with the output of the
code.
```{r show_data}
head(hh_table, 10)
```
## Including Plots
You can also embed plots, for example, here is a simple map of home locations in an HTS survey.
```{r map}
ggplot(hh_map, aes(x=reported_home_lon, y=reported_home_lat)) +
geom_point(size=2, color='blue', alpha=0.1) +
coord_equal() +
labs(x='', y='') +
theme_bw()
```
## About
This is a demonstration project to show how to present and interact with household travel survey data. The project and all source code is available on [Github](https://github.com/landisrm/rTED_2020).
Note: These data have been fully anonymized by randomizing the ids, locations, and descriptive variables. In addition the actual locations have been jittered.