# Generated by fusen: do not edit by hand
#' extract_six_from_col A function to sort decreasing and extract the first 6 elements of a given column
#' @param dataset dataset given to extract a column from (type = tibble, data.frame)
#' @param column column to sort and extract the first 6 elements from (type = numeric, character)
#' @importFrom dplyr select all_of pull slice_head
#' @importFrom tibble tibble
#' @return A data frame when the column is numeric
#' @export
#'
#' @examples
#' extract_six_from_col(dataset = datasets::mtcars, column = "mpg")
#' extract_six_from_col(squirrels, "lat")
extract_six_from_col <- function(dataset = datasets::mtcars, column = "mpg"){
dataset %>%
select(all_of(column)) %>%
pull() %>%
sort(decreasing = TRUE) %>%
tibble() %>%
slice_head(n = 6) %>%
pull()
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.