We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hai_density_qq_plot()
hai_density_qq_plot <- function(.data, .dist_name_col, .x_col, .y_col, .size = 1, .alpha = 0.382, .interactive = FALSE){ # Tidyeval ---- dist_name_var <- rlang::enquo(.dist_name_col) x_col_var <- rlang::enquo(.x_col) y_col_var <- rlang::enquo(.y_col) size <- as.numeric(.size) alpha <- as.numeric(.alpha) dnv_name <- rlang::quo_name(dist_name_var) xcv_name <- rlang::quo_name(x_col_var) ycv_name <- rlang::quo_name(y_col_var) # Checks ---- if(rlang::quo_is_missing(dist_name_var) | rlang::quo_is_missing(x_col_var) | rlang::quo_is_missing(y_col_var) ){ rlang::abort( "All parameters must be supplied: * .dist_name_col, * .x_col, and * .y_col" ) } if(!is.numeric(alpha) | (alpha > 1) | (alpha < 0)){ rlang::abort("The .alpha parameter must be a number between 0 and 1") } if(!is.numeric(size) | (size <= 0)){ rlang::abort("The .size parameter must be a number greater than 0") } # Data setup ---- data_tbl <- tibble::as_tibble(.data) %>% dplyr::ungroup() %>% dplyr::select( {{dist_name_var}}, {{x_col_var}}, {{y_col_var}} ) # Plots ---- plt <- ggplot2::ggplot( data = data_tbl, mapping = ggplot2::aes_string( sample = ycv_name, color = dnv_name, group = dnv_name ) ) + ggplot2::stat_qq(size = size, alpha = alpha) + ggplot2::stat_qq_line() + ggplot2::theme_minimal() + ggplot2::labs( title = "QQ Plot Comparison", color = "Distribution" ) + ggplot2::theme(legend.position = "bottom") if(.interactive){ plt <- plotly::ggplotly(plt) } # Return ---- return(plt) }
The text was updated successfully, but these errors were encountered:
084b8e1
spsanderson
No branches or pull requests
The text was updated successfully, but these errors were encountered: