From 295e71d321f5d077a6bf8ae9af41184d3b5dd093 Mon Sep 17 00:00:00 2001 From: "alex.hill@gmail.com" Date: Mon, 2 Dec 2024 12:59:58 +0000 Subject: [PATCH] update docs --- NAMESPACE | 2 ++ R/epikinetics-package.R | 2 +- R/plot.R | 8 +++++--- man/plot.biokinetics_individual_trajectories.Rd | 8 +++++--- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/NAMESPACE b/NAMESPACE index 8d14a98..620d689 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -23,6 +23,8 @@ importFrom(data.table,data.table) importFrom(ggplot2,aes) importFrom(ggplot2,annotate) importFrom(ggplot2,facet_wrap) +importFrom(ggplot2,geom_bar) +importFrom(ggplot2,geom_density_2d) importFrom(ggplot2,geom_hline) importFrom(ggplot2,geom_line) importFrom(ggplot2,geom_path) diff --git a/R/epikinetics-package.R b/R/epikinetics-package.R index 4b8a1ae..77fec4a 100644 --- a/R/epikinetics-package.R +++ b/R/epikinetics-package.R @@ -11,7 +11,7 @@ #' @importFrom data.table .NGRP #' @importFrom data.table .SD #' @importFrom data.table data.table -#' @importFrom ggplot2 aes annotate facet_wrap geom_point geom_ribbon geom_line geom_smooth +#' @importFrom ggplot2 aes annotate facet_wrap geom_point geom_ribbon geom_line geom_smooth geom_bar geom_density_2d #' geom_vline geom_hline geom_path labs ggplot guides guide_legend scale_y_continuous #' scale_x_continuous scale_x_date sec_axis #' @useDynLib epikinetics, .registration = TRUE diff --git a/R/plot.R b/R/plot.R index 4caec7a..b15b595 100644 --- a/R/plot.R +++ b/R/plot.R @@ -150,13 +150,15 @@ plot.biokinetics_population_trajectories <- function(x, ..., #' generated by running biokinetics$simulate_individual_trajectories(). See #' \href{../../epikinetics/html/biokinetics.html#method-biokinetics-simulate_individaul_trajectories}{\code{biokinetics$simulate_individual_trajectories()}} #' @param \dots Further arguments passed to the method. +#' @param data Optional data.table containing raw data as provided to the biokinetics model. #' @param min_day Optional minimum date #' @param max_day Optional maximum date -#' @param pid Optional vector of ids to plot simulated trajectories for a subset of individuals. Can only be used +#' @param pids Optional vector of ids to plot simulated trajectories for a subset of individuals. Can only be used #' if x has been generated with summarise=FALSE. #' @param titre_types Optional vector of titre types to include. #' @export -plot.biokinetics_individual_trajectories <- function(x, ..., data = NULL, +plot.biokinetics_individual_trajectories <- function(x, ..., + data = NULL, min_day = NULL, max_day = NULL, pids = NULL, @@ -165,7 +167,7 @@ plot.biokinetics_individual_trajectories <- function(x, ..., data = NULL, # Declare variables to suppress notes when compiling package # https://github.com/Rdatatable/data.table/issues/850#issuecomment-259466153 calendar_day <- value <- me <- mu <- titre_type <- day <- pid <- NULL - ind_mu_sum <- lo <- hi <- NULL + ind_mu_sum <- lo <- hi <- draw <- NULL if (is.null(min_day)) { min_day <- min(x$calendar_day) diff --git a/man/plot.biokinetics_individual_trajectories.Rd b/man/plot.biokinetics_individual_trajectories.Rd index 2e188bf..e7a5426 100644 --- a/man/plot.biokinetics_individual_trajectories.Rd +++ b/man/plot.biokinetics_individual_trajectories.Rd @@ -21,14 +21,16 @@ generated by running biokinetics$simulate_individual_trajectories(). See \item{\dots}{Further arguments passed to the method.} +\item{data}{Optional data.table containing raw data as provided to the biokinetics model.} + \item{min_day}{Optional minimum date} \item{max_day}{Optional maximum date} -\item{titre_types}{Optional vector of titre types to include.} - -\item{pid}{Optional vector of ids to plot simulated trajectories for a subset of individuals. Can only be used +\item{pids}{Optional vector of ids to plot simulated trajectories for a subset of individuals. Can only be used if x has been generated with summarise=FALSE.} + +\item{titre_types}{Optional vector of titre types to include.} } \description{ Plot method for "biokinetics_individual_trajectories" class