Skip to content

Commit

Permalink
update site
Browse files Browse the repository at this point in the history
Fix #75
  • Loading branch information
spsanderson committed Mar 3, 2022
1 parent 9841d31 commit 2d49670
Show file tree
Hide file tree
Showing 66 changed files with 661 additions and 444 deletions.
22 changes: 17 additions & 5 deletions R/est-param-beta.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,21 @@
#'
#' @examples
#' library(dplyr)
#' library(ggplot2)
#'
#' tb <- tidy_beta(.n = 50, .shape1 = 2.5, .shape2 = 1.4, .ncp = 0) %>%
#' pull(y)
#' util_beta_param_estimate(tb)
#' x <- mtcars$mpg
#' output <- util_beta_param_estimate(x)
#'
#' output$parameter_tbl
#'
#' output$combined_data_tbl %>%
#' ggplot(aes(x = dx, y = dy, group = dist_type, color = dist_type)) +
#' geom_line() +
#' theme_minimal() +
#' theme(legend.position = "bottom")
#'
#' tb <- rbeta(50, 2.5, 1.4)
#' util_beta_param_estimate(tb)$parameter_tbl
#'
#' @return
#' A tibble
Expand All @@ -37,9 +48,11 @@ util_beta_param_estimate <- function(.x, .auto_gen_empirical = TRUE){
x_term <- as.numeric(.x)
minx <- min(x_term)
maxx <- max(x_term)
n <- length(x_term)
unique_terms <- length(unique(x_term))

# Checks ----
if (length(n) < 2 || length(unique(x_term)) < 2){
if (n < 2 || unique_terms < 2){
rlang::abort(
message = "The data must have at least two (2) unique data points.",
use_cli_format = TRUE
Expand Down Expand Up @@ -70,7 +83,6 @@ util_beta_param_estimate <- function(.x, .auto_gen_empirical = TRUE){
}

# Get params ----
n <- length(x_term)
m <- mean(x_term, na.rm = TRUE)
s2 <- var(x_term, na.rm = TRUE)

Expand Down
24 changes: 12 additions & 12 deletions docs/articles/getting-started.html

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

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 12 additions & 12 deletions docs/index.html

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

2 changes: 1 addition & 1 deletion docs/pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pkgdown: 2.0.2
pkgdown_sha: ~
articles:
getting-started: getting-started.html
last_built: 2022-02-28T16:21Z
last_built: 2022-03-03T20:39Z
urls:
reference: https://github.com/spsanderson/TidyDensity/reference
article: https://github.com/spsanderson/TidyDensity/articles
Expand Down
Binary file modified docs/reference/Rplot001.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/reference/Rplot002.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/reference/figures/README-more_than_nine_simulations-1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/reference/figures/README-more_than_nine_simulations-3.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/reference/figures/README-more_than_nine_simulations-4.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/reference/figures/README-plot_density-1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/reference/figures/README-plot_density-3.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/reference/figures/README-plot_density-4.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions docs/reference/index.html

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

Binary file modified docs/reference/tidy_autoplot-1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/reference/tidy_autoplot-2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2d49670

Please sign in to comment.