Learn R Programming

abasequence (version 0.1.0)

generate_length_aba: Generate Length of Consecutive 'ABA'-Coded Sequences

Description

This function calculates the length of consecutive 'ABA'-coded sequences that share common elements in their ID. It assigns NA to non-'ABA' codes.

Usage

generate_length_aba(codes_df)

Value

A dataframe of codes with an additional column representing the length of 'ABA' sequences.

Arguments

codes_df

A dataframe of codes generated by the generate_codes function and processed by the create_is_aba function.

Examples

Run this code
speaker_no <- c(3, 2, 3, 1, 4, 2, 4, 1, 4, 3, 2, 3)
sequences <- generate_sequences(speaker_no, 3)
codes <- generate_codes(sequences)
aba <- create_is_aba(codes)
length_aba <- generate_length_aba(aba)

Run the code above in your browser using DataLab