pc_overlap: Calculate Percentage Overlap Between Two Vectors

View source: R/CodeAndRoll2.R

pc_overlapR Documentation

Calculate Percentage Overlap Between Two Vectors

Description

Computes the percentage of overlap between two vectors based on the specified basis of calculation.

Usage

pc_overlap(x, y, basis = "x", prefix = NULL, suffix = NULL, ...)

Arguments

x

The first vector for overlap calculation.

y

The second vector for overlap calculation.

basis

A character string specifying the basis for calculating the percentage overlap. Can be "x" for the length of x, "y" for the length of y, or "sum" for the sum of lengths of both x and y. Default is "x".

prefix

A prefix to add to the output string (default: NULL).

suffix

A suffix to add to the output string (default: NULL).

...

Additional arguments to pass to percentage_formatter().

Value

The percentage of overlap between x and y based on the specified basis.

Examples

x <- 1:5
y <- 3:8
pc_overlap(x, y, basis = "x")


vertesy/CodeAndRoll2 documentation built on Nov. 20, 2024, 5:23 a.m.