-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPHSM_code.Rmd
More file actions
52 lines (39 loc) · 1.3 KB
/
Copy pathPHSM_code.Rmd
File metadata and controls
52 lines (39 loc) · 1.3 KB
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
---
title: "phsm_code"
author: "Carina Peng"
date: "7/30/2020"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(lubridate)
library(data.table)
library(ggplot2)
library(ggthemes)
library(reshape)
library(reshape2)
library(tidyr)
library(tidyverse)
library(scales)
library(magrittr)
library(dplyr)
library(pyramid)
#library(XML)
library(plyr)
library(foreign)
library(ggpol)
library(data.table)
x <- read.csv("/Users/carinapeng/Projects/PAHO Risk Assessment/WHO_PHSM_Cleaned_V1_20_07_22.csv")
```
```{r}
social = ifelse("Social and physical distancing measures" %in% x$who_category, 0, 1)
isolation = ifelse("Surveillance and response measures" %in% x$who_category, 0, 1)
support = ifelse("Social and physical distancing measures" %in% x$who_category, 0, 1)
contact = ifelse("Tracing and quarantining contacts" %in% x$who_subcategory, 0, 1)
gathering = ifelse("Gatherings, businesses and services" %in% x$who_subcategory, 0, 1)
disturbance = ifelse("Gatherings, businesses and services" %in% x$who_subcategory, 0, 1)
combined <- data.frame(value = rbind(social, isolation, support, contact, gathering, disturbance))
combined_transpose <- data.frame(transpose(combined))
rownames(combined_transpose) <- colnames(combined)
colnames(combined_transpose) <- rownames(combined)
```