Learn R Programming

abasequence (version 0.1.0)

count_events: Count the Number of Occurrences of Each Event in a Sequence

Description

This function counts the number of occurrences of each unique event in a sequence. The result is a dataframe with two columns: ID and Frequency.

Usage

count_events(event_vector)

Value

A dataframe with two columns: ID and Frequency, showing the number of occurrences of each event.

Arguments

event_vector

A numeric vector representing a sequence of events.

Examples

Run this code
speaker_no <- c(3, 2, 3, 1, 4, 2, 4, 1, 4, 3, 2, 3)
count_events(speaker_no)

Run the code above in your browser using DataLab