summarize_metrics function

Summarize metrics with common descriptors

Summarize metrics with common descriptors

lifecycle::badge("experimental")

Summarizes all numeric columns. Counts the NAs and Infs in the columns.

summarize_metrics(data, cols = NULL, na.rm = TRUE, inf.rm = TRUE)

Arguments

  • data: data.frame with numeric columns to summarize.
  • cols: Names of columns to summarize. Non-numeric columns are ignored. (Character)
  • na.rm: Whether to remove NAs before summarizing. (Logical)
  • inf.rm: Whether to remove Infs before summarizing. (Logical)

Returns

tibble where each row is a descriptor of the column.

The Measure column contains the name of the descriptor.

The NAs row is a count of the NAs in the column.

The INFs row is a count of the Infs in the column.

Examples

# Attach packages library(cvms) library(dplyr) df <- data.frame("a" = c("a", "a", "a", "b", "b", "b", "c", "c", "c"), "b" = c(0.8, 0.6, 0.3, 0.2, 0.4, 0.5, 0.8, 0.1, 0.5), "c" = c(0.2, 0.3, 0.4, 0.6, 0.5, 0.8, 0.1, 0.8, 0.3)) # Summarize all numeric columns summarize_metrics(df) # Summarize column "b" summarize_metrics(df, cols = "b")

Author(s)

Ludvig Renbo Olsen, r-pkgs@ludvigolsen.dk

  • Maintainer: Ludvig Renbo Olsen
  • License: MIT + file LICENSE
  • Last published: 2025-03-07