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

View source: R/ABA_script.R

count_eventsR Documentation

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)

Arguments

event_vector

A numeric vector representing a sequence of events.

Value

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

Examples

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


abasequence documentation built on July 26, 2023, 5:43 p.m.