count_distinct_elements: Count Distinct Elements in Sequences

View source: R/sequence_length_summary.R

count_distinct_elementsR Documentation

Count Distinct Elements in Sequences

Description

This function counts the number of distinct elements across all sequences, where each sequence is split by spaces.

Usage

count_distinct_elements(sequences)

Arguments

sequences

A character vector where each element is a sequence of elements separated by spaces.

Value

An integer representing the number of distinct elements across all sequences.

Examples

sequences <- c('hello world', 'hello world hello', 'hello world hello world')
count_distinct_elements(sequences)

AnimalSequences documentation built on Sept. 30, 2024, 9:18 a.m.