Skip to content
Snippets Groups Projects
Commit 0409143d authored by pqiao29's avatar pqiao29
Browse files

fix check warnings

parent ec8f96ca
No related branches found
No related tags found
No related merge requests found
......@@ -28,9 +28,7 @@ export(recovery.FUN)
export(seiqhrf)
export(simulate_seiqhrf)
export(vary_param)
import(dplyr)
import(ggplot2)
import(lubridate)
importFrom(EpiModel,get_prev.icm)
importFrom(EpiModel,ssample)
importFrom(EpiModel,verbose.icm)
......@@ -39,11 +37,13 @@ importFrom(dplyr,"%>%")
importFrom(dplyr,between)
importFrom(dplyr,bind_rows)
importFrom(dplyr,filter)
importFrom(dplyr,full_join)
importFrom(dplyr,mutate)
importFrom(dplyr,select)
importFrom(foreach,"%dopar%")
importFrom(foreach,foreach)
importFrom(future,availableCores)
importFrom(lubridate,ymd)
importFrom(stats,pweibull)
importFrom(stats,rbinom)
importFrom(stats,rgeom)
......
......@@ -32,7 +32,7 @@
#' @importFrom dplyr bind_rows
#' @importFrom dplyr select
#' @importFrom dplyr filter
#' @import lubridate
#' @importFrom lubridate ymd
#' @import ggplot2
#' @export
plot.seiqhrf <- function(x, method = NULL,
......@@ -104,7 +104,7 @@ plot.seiqhrf <- function(x, method = NULL,
#' @importFrom dplyr bind_rows
#' @importFrom dplyr select
#' @importFrom dplyr filter
#' @import lubridate
#' @importFrom lubridate ymd
#' @import ggplot2
#' @export
plot.list <- function(x, comp_remove = "none",
......@@ -165,15 +165,15 @@ plot.list <- function(x, comp_remove = "none",
#' @importFrom dplyr filter
#' @import ggplot2
#' @export
plot_sirplus <- function(x, comp_remove = comp_remove,
time_lim = time_lim,
ci = ci,
sep_compartments = sep_compartments,
trans = trans,
known = known,
start_date = start_date,
x_axis = x_axis,
plot_title = plot_title, ...){
plot_sirplus <- function(x, comp_remove,
time_lim,
ci,
sep_compartments,
trans,
known,
start_date,
x_axis,
plot_title, ...){
# Convert from seiqhrf object to dataframe
plot_df <- format_sims(x, time_lim = time_lim, start_date = start_date)
......@@ -306,7 +306,7 @@ plot_times <- function(sim) {
#' @return dataframe
#'
#' @export
format_sims <- function(x, time_lim = time_lim, start_date = start_date){
format_sims <- function(x, time_lim, start_date){
# Merge models to plot together
if(class(x) == "seiqhrf"){
......@@ -343,11 +343,12 @@ format_sims <- function(x, time_lim = time_lim, start_date = start_date){
#' Get 95\% confidence intervals
#'
#' @param x An seiqhrf object returned from function \code{\link{seiqhrf}}.
#' @param known Dataframe with known compartment numbers to plot alongside
#' @param plot_df Dataframe with known compartment numbers to plot alongside
#' projections
#'
#' @return dataframe with CIs and sd added
#' @importFrom tidyr separate
#' @importFrom dplyr full_join
#'
#' @export
#'
......@@ -404,22 +405,23 @@ get_ci <- function(x, plot_df){
ci_info[is.na(ci_info)] <- 0
plot_df <- plot_df %>%
full_join(ci_info, by = c('time', 'compartment', 'experiment', 'sim'))
dplyr::full_join(ci_info, by = c('time', 'compartment', 'experiment', 'sim'))
return(plot_df)
}
#' Add known counts to sims dataframe for ggplot
#'
#' @param x An seiqhrf object returned from function \code{\link{seiqhrf}}.
#' @param plot_df An seiqhrf object returned from function \code{\link{seiqhrf}}.
#' @param known Dataframe with known compartment numbers to plot alongside
#' projections
#' @param start_date Date for day 0.
#'
#' @return dataframe with known data added
#'
#' @export
#'
add_known <- function(plot_df, known = known, start_date = start_date){
add_known <- function(plot_df, known, start_date){
# Add Date to known data
missing_cols <- setdiff(names(plot_df), names(known))
......
......@@ -15,7 +15,6 @@
#'
#' @return ggplot2 object
#'
#' @import dplyr
#' @importFrom tidyr pivot_longer
plot_models <- function(sims = baseline_sim,
......
......@@ -4,13 +4,15 @@
\alias{add_known}
\title{Add known counts to sims dataframe for ggplot}
\usage{
add_known(plot_df, known = known, start_date = start_date)
add_known(plot_df, known, start_date)
}
\arguments{
\item{plot_df}{An seiqhrf object returned from function \code{\link{seiqhrf}}.}
\item{known}{Dataframe with known compartment numbers to plot alongside
projections}
\item{x}{An seiqhrf object returned from function \code{\link{seiqhrf}}.}
\item{start_date}{Date for day 0.}
}
\value{
dataframe with known data added
......
......@@ -4,7 +4,7 @@
\alias{format_sims}
\title{Format seiqhrf objects into dataframe for ggplot}
\usage{
format_sims(x, time_lim = time_lim, start_date = start_date)
format_sims(x, time_lim, start_date)
}
\arguments{
\item{x}{An seiqhrf object returned from function \code{\link{seiqhrf}}.}
......
......@@ -9,7 +9,7 @@ get_ci(x, plot_df)
\arguments{
\item{x}{An seiqhrf object returned from function \code{\link{seiqhrf}}.}
\item{known}{Dataframe with known compartment numbers to plot alongside
\item{plot_df}{Dataframe with known compartment numbers to plot alongside
projections}
}
\value{
......
......@@ -6,15 +6,15 @@
\usage{
plot_sirplus(
x,
comp_remove = comp_remove,
time_lim = time_lim,
ci = ci,
sep_compartments = sep_compartments,
trans = trans,
known = known,
start_date = start_date,
x_axis = x_axis,
plot_title = plot_title,
comp_remove,
time_lim,
ci,
sep_compartments,
trans,
known,
start_date,
x_axis,
plot_title,
...
)
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment