diff --git a/NEWS.md b/NEWS.md index 5b46d4a5..39e35716 100644 --- a/NEWS.md +++ b/NEWS.md @@ -6,13 +6,14 @@ None ## New Features 1. #468 - Add function `util_negative_binomial_aic()` to calculate the AIC for the negative binomial distribution. 2. #470 - Add function `util_ztn_binomial_param_estimate()` and `util_rztnbinom_aic()` to estimate the parameters and calculate the AIC for the zero-truncated negative binomial distribution. Also added `util_ztn_binomial_stats_tbl()` -3. #467 - Add function `util_zero_truncated_poisson_param_estimate()` to estimate +3. #471 - Add function `util_zero_truncated_poisson_param_estimate()` to estimate the parameters of the zero-truncated Poisson distribution. Add function `util_zero_truncated_poisson_aic()` to calculate the AIC for the zero-truncated Poisson distribution. Add function `util_zero_truncated_poisson_stats_tbl()` to create a summary table of the zero-truncated Poisson distribution. 4. #472 - Add function `util_f_param_estimate()` and `util_f_aic()` to estimate the parameters and calculate the AIC for the F distribution. ## Minor Improvements and Fixes 1. Fix #468 - Update `util_negative_binomial_param_estimate()` to add the use of `optim()` for parameter estimation. +2. Fix #465 - Add names to columns when `.return_tibble = TRUE` for `quantile_normalize()` # TidyDensity 1.4.0 diff --git a/R/utils-quantile-normalize.R b/R/utils-quantile-normalize.R index 6dfd58ac..113fdf0c 100644 --- a/R/utils-quantile-normalize.R +++ b/R/utils-quantile-normalize.R @@ -41,8 +41,8 @@ #' sapply(function(x) quantile(x, probs = seq(0, 1, 1 / 4))) #' #' quantile_normalize( -#' data.frame(sample1 = rnorm(30), -#' sample2 = rnorm(30)), +#' data.frame(rnorm(30), +#' rnorm(30)), #' .return_tibble = TRUE) #' #' @seealso @@ -137,15 +137,15 @@ quantile_normalize <- function(.data, .return_tibble = FALSE) { ) } - return( - list( - normalized_data = normalized_data, - row_means = row_means, - #sorted_data = sorted_data, - #column_rank_indices = rank_indices, - duplicated_ranks = duplicated_ranks, - duplicated_rank_row_indices = duplicated_rank_vector, - duplicated_rank_data = duplicated_rank_data - ) + output <- list( + normalized_data = normalized_data, + row_means = row_means, + #sorted_data = sorted_data, + #column_rank_indices = rank_indices, + duplicated_ranks = duplicated_ranks, + duplicated_rank_row_indices = duplicated_rank_vector, + duplicated_rank_data = duplicated_rank_data ) + + return(output) } diff --git a/man/quantile_normalize.Rd b/man/quantile_normalize.Rd index dd71acb7..b388688e 100644 --- a/man/quantile_normalize.Rd +++ b/man/quantile_normalize.Rd @@ -47,8 +47,8 @@ as.data.frame(normalized_data$normalized_data) |> sapply(function(x) quantile(x, probs = seq(0, 1, 1 / 4))) quantile_normalize( -data.frame(sample1 = rnorm(30), - sample2 = rnorm(30)), +data.frame(rnorm(30), + rnorm(30)), .return_tibble = TRUE) }