Skip to content

Commit

Permalink
Fixes #465
Browse files Browse the repository at this point in the history
  • Loading branch information
spsanderson committed May 9, 2024
1 parent 8b12100 commit 055cd60
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
3 changes: 2 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
24 changes: 12 additions & 12 deletions R/utils-quantile-normalize.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
}
4 changes: 2 additions & 2 deletions man/quantile_normalize.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 055cd60

Please sign in to comment.