diff --git a/NAMESPACE b/NAMESPACE index 51b6dd7..7fa16cf 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -25,4 +25,5 @@ importFrom(ggplot2,geom_smooth) importFrom(ggplot2,ggplot) importFrom(ggplot2,guide_legend) importFrom(ggplot2,guides) +importFrom(ggplot2,scale_y_continuous) useDynLib(epikinetics, .registration = TRUE) diff --git a/R/epikinetics-package.R b/R/epikinetics-package.R index 4404fc3..35b5299 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 facet_wrap geom_point geom_ribbon geom_line geom_smooth ggplot guides guide_legend +#' @importFrom ggplot2 aes facet_wrap geom_point geom_ribbon geom_line geom_smooth ggplot guides guide_legend scale_y_continuous #' @useDynLib epikinetics, .registration = TRUE ## usethis namespace: end diff --git a/R/plot.R b/R/plot.R index 70b9c0f..9e0a319 100644 --- a/R/plot.R +++ b/R/plot.R @@ -23,12 +23,12 @@ plot_prior_predictive <- function(priors, validate_required_cols(data, c("time_since_last_exp", "value")) } params <- data.table( - t0 = rnorm(n_draws, priors$mu_t0, priors$sigma_t0), # titre value at t0 - tp = rnorm(n_draws, priors$mu_tp, priors$sigma_tp), # time of peak - ts = rnorm(n_draws, priors$mu_ts, priors$sigma_ts), # time of set point - m1 = rnorm(n_draws, priors$mu_m1, priors$sigma_m1), # gradient 1 - m2 = rnorm(n_draws, priors$mu_m2, priors$sigma_m2), # gradient 2 - m3 = rnorm(n_draws, priors$mu_m3, priors$sigma_m3) # gradient 3 + t0 = stats::rnorm(n_draws, priors$mu_t0, priors$sigma_t0), # titre value at t0 + tp = stats::rnorm(n_draws, priors$mu_tp, priors$sigma_tp), # time of peak + ts = stats::rnorm(n_draws, priors$mu_ts, priors$sigma_ts), # time of set point + m1 = stats::rnorm(n_draws, priors$mu_m1, priors$sigma_m1), # gradient 1 + m2 = stats::rnorm(n_draws, priors$mu_m2, priors$sigma_m2), # gradient 2 + m3 = stats::rnorm(n_draws, priors$mu_m3, priors$sigma_m3) # gradient 3 ) times <- data.table(t = 1:tmax) @@ -66,7 +66,7 @@ plot_data <- function(data, covariates) { #' Plot method for "biokinetics_population_trajectories" class #' -#' @param x An object of class "biokinetics_population_trajectories". These are +#' @param trajectories An object of class "biokinetics_population_trajectories". These are #' generated by running biokinetics$simulate_populate_trajectories(). #' @param data Optional data.table containing raw data as provided to the #' biokinetics model. diff --git a/man/plot.biokinetics_population_trajectories.Rd b/man/plot.biokinetics_population_trajectories.Rd index d4f2321..a8ac07f 100644 --- a/man/plot.biokinetics_population_trajectories.Rd +++ b/man/plot.biokinetics_population_trajectories.Rd @@ -7,11 +7,11 @@ \method{plot}{biokinetics_population_trajectories}(trajectories, data = NULL) } \arguments{ +\item{trajectories}{An object of class "biokinetics_population_trajectories". These are +generated by running biokinetics$simulate_populate_trajectories().} + \item{data}{Optional data.table containing raw data as provided to the biokinetics model.} - -\item{x}{An object of class "biokinetics_population_trajectories". These are -generated by running biokinetics$simulate_populate_trajectories().} } \description{ Plot method for "biokinetics_population_trajectories" class