-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implimented potential SK simulation fix
- Loading branch information
1 parent
da22e11
commit bb9fc68
Showing
1 changed file
with
2 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,12 @@ | ||
## create matrix for counties starting social distancing based on South Korea R0 reductions | ||
##we're actually hardcoding this, but here's a dummy file. | ||
## R0 in SK .6-1.3, mid 2-3 | ||
|
||
library(dplyr) | ||
|
||
# West coast | ||
county.status <- read.csv(paste0(foldername,'geodata.csv')) | ||
dates <- seq.Date(as.Date(ti_str), as.Date(tf_str), 1) | ||
|
||
NPI <- as.data.frame(matrix(0, dim(county.status)[1],length(dates))) | ||
colnames(NPI) <- as.Date(dates) | ||
rownames(NPI) <- county.status$geoid | ||
|
||
## Introducing NPI: randomly assign a pc value to each county based on Bootsma paper values | ||
NPI[ , colnames(NPI) >= as.Date("2020/03/19") & colnames(NPI) <= as.Date("2020/05/14") ] <- 1 | ||
county.status$pc <- replicate(dim(county.status)[1], runif(dim(county.status)[1], 1.4, 1.7)) | ||
NPI <- NPI * county.status$pc |