knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
library(relper)
library(dplyr)

summary_ functions summarize data and return metrics related to them.

summary_cat

The goal of summary_cat is to summarize categorical variables.

set.seed(123);g <- c(sample(letters,100,replace = TRUE),NA)

summary_cat(g)

summary_num

The goal of summary_num is to summarize numeric variables.

set.seed(123);x <- c(rnorm(10),NA,10)

summary_num(x) %>% glimpse()

It is also possible to return metrics related to type of values we have:

summary_num(x,type = TRUE) %>% glimpse()

We can also add other means.

summary_num(x,other_means = TRUE) %>% glimpse()

summary_seq

The goal of summary_seq is to compute the number of sequential repeated values.

y <- c(1, 1, 1, 2, 2, 6, 7, 1, 1)

summary_seq(y)

summary_xy

The goal of summary_xy is to summary two numeric variables, by computing some metrics such as: Pearson, Kendall and Spearman correlation coefficients.

x <- rnorm(100)

y <- rnorm(100)

summary_xy(x,y)


vbfelix/relper documentation built on May 10, 2024, 10:50 p.m.