intersect_perc | R Documentation |
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.
intersect_perc(vector1, vector2)
vector1 |
A character vector. |
vector2 |
A character vector. |
The percentage of intersection between the two character vectors.
vector1 <- c("A", "B", "C", "D", "E")
vector2 <- c("C", "D", "E", "F", "G")
intersect_perc(vector1, vector2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.