Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sim=c("min", "mean", "max") option for plot.netsim for type = "network" #73

Closed
smjenness opened this issue Aug 19, 2014 · 3 comments · Fixed by #171
Closed

sim=c("min", "mean", "max") option for plot.netsim for type = "network" #73

smjenness opened this issue Aug 19, 2014 · 3 comments · Fixed by #171

Comments

@smjenness
Copy link
Collaborator

Options would be sim=c("min", "mean", "max")

This would be able to automate this type of network plotting:

low <- which.min(sim1$epi$i.num[500, ])
high <- which.max(sim1$epi$i.num[500, ])

par(mfrow = c(1, 2))
plot(sim1, type = "network", col.status = TRUE, 
     at = 500, sim = low)
plot(sim1, type = "network", col.status = TRUE, 
     at = 500, sim = high)
@smjenness
Copy link
Collaborator Author

The day 4 NME tutorial should be updated accordingly with this

@smjenness
Copy link
Collaborator Author

This can actually be in the as.data.frame method for both ICM and network models, then the plot option can easily call this for the sim argument. UPDATE: nevermind, these calculations need to be time-specific, whereas as.data.frame is not.

@smjenness smjenness added the icm label Aug 19, 2014
@smjenness
Copy link
Collaborator Author

Also need to update Day 5 tutorial 1:

get_msim <- function(x, at) {
  which.min(abs(as.numeric(x$epi$i.num[at, ]) - 
              mean(as.numeric(x$epi$i.num[at, ]))))
}
med.si1 <- get_msim(si1, 500)
med.si2 <- get_msim(si2, 500)

@smjenness smjenness modified the milestones: EpiModel v1.0.2, EpiModel v1.1.0, EpiModel v1.0.3 Aug 19, 2014
@smjenness smjenness modified the milestones: EpiModel v1.0.3, EpiModel v1.0.4 Aug 31, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant