-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvishakh charts.Rmd
91 lines (63 loc) · 1.95 KB
/
vishakh charts.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
## Import Statements
```{r}
library(highcharter)
library(dplyr)
```
## reading in data
```{r}
# obestiy
childhood_obesity <- readRDS(file = 'clean_data/Children/childhood_obesity_data.rds')
#physical inactivity
childhood_inactivity <- readRDS(file = 'clean_data/Children/child_inactivity_data.rds')
#WIC Obesity
wic_obesity <- readRDS(file = 'clean_data/Children/wic_obesity_data.rds')
#smoking trends
tobacco_trends <- readRDS(file = 'clean_data/Children/child_tobacco_trend.rds')
#vaping us
vaping_use <- readRDS(file = 'clean_data/Children/child_vape_data.rds')
#teen suicides
teen_suicides <- readRDS(file = 'clean_data/Children/teen_suicide_data.rds')
#uninsured rates
child_uninsurance <- readRDS(file = 'clean_data/Children/child_uninsured_data.rds')
diabetes_trends_women_18_44 <- read_rds("clean_data/maternity/diabetes_trends_women_18_44.rds")
```
# Making the charts
## Teen suicide rates
```{r}
## Seems to be complete, need formatting
highchart()
hchart(teen_suicides,
'line',
hcaes(x = edition, y = value, group = state_name)) %>%
hc_title(text = "Teen Suicide Rates") %>%
hc_xAxis()
```
## Physical Inactivity
```{r}
## need formatting
highchart()
hchart(childhood_inactivity,
'line',
hcaes(x = year, y = percentage)) %>%
hc_title(text = "Percentage of Texas high school students who were physically active for a total of 60 minutes per day on all seven days of the past seven days")
```
## Current Smoking Rates
```{r}
## Ask and see if there is more data about this
highchart()
hchart(tobacco_trends,
'line',
hcaes(x = year, y = data_value)) %>%
hc_title(text = "Percentage of US high school students who currently use tobacco")
```
```{r}
## this needs more data too
## this needs to become a line chart, fix this
hchart(child_uninsurance%>%filter(`peer` == 'Y' | `name` == 'Texas'),
'line',
hcaes(x = year, y = uninsured_percent, group = peer))
```
```{r}
highchart(
)
```