#' General summary values about a dataframe
#'
#' @param .data a dataframe
#'
#' @return a datframe with the summary values
#' @export
#'
#' @importFrom dplyr as_tibble select
#' @importFrom purrr map_chr
#'
#' @examples
#' scan_data(iris)
scan_data <- function(.data) {
rbind(
c("Rows", nrow(.data)),
c("Columns", ncol(.data)),
map_chr(.data, class) %>%
table() %>%
as_tibble(),
c("All NAs rows",
apply(.data, 1, function(a) all(is.na(a))) %>%
sum()),
c("All NAs columns",
apply(.data, 2, function(a) all(is.na(a))) %>%
sum())
) %>%
select(Object = ".", N = n)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.