50% off: Unlimited data and AI learning.
State of Data and AI Literacy Report 2025

AnimalSequences (version 0.2.0)

count_distinct_elements: 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)

Value

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

Arguments

sequences

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

Examples

Run this code
sequences <- c('hello world', 'hello world hello', 'hello world hello world')
count_distinct_elements(sequences)

Run the code above in your browser using DataLab