intersect_perc: Compute the percentage of intersection between two character...

View source: R/Utils.R

intersect_percR Documentation

Compute the percentage of intersection between two character vectors

Description

This function calculates the percentage of intersection between two character vectors. It converts the vectors to sets, finds the intersection, and computes the percentage based on the size of the intersection relative to the first vector.

Usage

intersect_perc(vector1, vector2)

Arguments

vector1

A character vector.

vector2

A character vector.

Value

The percentage of intersection between the two character vectors.

Examples

vector1 <- c("A", "B", "C", "D", "E")
vector2 <- c("C", "D", "E", "F", "G")
intersect_perc(vector1, vector2)

eisascience/scCustFx documentation built on June 2, 2025, 3:59 a.m.