diff --git a/R/plot.R b/R/plot.R index 46b61e2..986d08c 100644 --- a/R/plot.R +++ b/R/plot.R @@ -17,7 +17,7 @@ plot.biokinetics_priors <- function(x, # Declare variables to suppress notes when compiling package # https://github.com/Rdatatable/data.table/issues/850#issuecomment-259466153 - t0 <- tp <- ts <- m1 <- m2 <- m3 <- NULL + t0 <- tp <- ts <- m1 <- m2 <- m3 <- censored <- NULL time_since_last_exp <- me <- lo <- hi <- value <- mu <- NULL if (!is.null(data)) { @@ -64,7 +64,7 @@ plot_sero_data <- function(data, covariates = character(0)) { add_censored_indicator(data) # Declare variables to suppress notes when compiling package # https://github.com/Rdatatable/data.table/issues/850#issuecomment-259466153 - time_since_last_exp <- value <- titre_type <- NULL + time_since_last_exp <- value <- titre_type <- censored <- NULL ggplot(data) + geom_point(aes(x = time_since_last_exp, y = value, colour = titre_type, shape = censored), @@ -90,7 +90,7 @@ plot.biokinetics_population_trajectories <- function(x, ..., data = NULL) { # Declare variables to suppress notes when compiling package # https://github.com/Rdatatable/data.table/issues/850#issuecomment-259466153 time_since_last_exp <- value <- me <- titre_type <- lo <- hi <- NULL - day <- last_exp_day <- NULL + day <- last_exp_day <- censored <- mu <- .draw <- NULL if (attr(x, "summarised")) { plot <- ggplot(x) + @@ -127,6 +127,9 @@ facet_formula <- function(covariates) { } add_censored_indicator <- function(data) { + # Declare variables to suppress notes when compiling package + # https://github.com/Rdatatable/data.table/issues/850#issuecomment-259466153 + censored <- NULL if (!("censored" %in% colnames(data))) { # censored is an optional column in input data # if not present, treat all points as uncensored diff --git a/R/utils.R b/R/utils.R index feab3a0..4089cb2 100644 --- a/R/utils.R +++ b/R/utils.R @@ -17,6 +17,7 @@ convert_log2_scale <- function( #' @return A data.table, identical to the input data but with specified columns transformed. #' @param dt_in data.table containing data to be transformed from base 2 log to natural scale. #' @param vars_to_transform Names of columns to apply the transformation to. +#' @param lower_limit The lowest value in the original dataset. #' @export convert_log2_scale_inverse <- function(dt_in, vars_to_transform, lower_limit) { dt_out <- data.table::copy(dt_in) diff --git a/man/convert_log2_scale_inverse.Rd b/man/convert_log2_scale_inverse.Rd index f5d22ae..b3be326 100644 --- a/man/convert_log2_scale_inverse.Rd +++ b/man/convert_log2_scale_inverse.Rd @@ -10,6 +10,8 @@ convert_log2_scale_inverse(dt_in, vars_to_transform, lower_limit) \item{dt_in}{data.table containing data to be transformed from base 2 log to natural scale.} \item{vars_to_transform}{Names of columns to apply the transformation to.} + +\item{lower_limit}{The lowest value in the original dataset.} } \value{ A data.table, identical to the input data but with specified columns transformed.