Learn R Programming

conversim (version 0.1.0)

agg_seq: Aggregate Similarity Sequence

Description

Aggregate similarity sequence for a single dyad

Usage

agg_seq(sequence, num_segments)

Value

A numeric vector of aggregated similarity scores

Arguments

sequence

A numeric vector of similarity scores for a single dyad

num_segments

The number of segments to aggregate into

Details

This function aggregates a similarity sequence into a specified number of segments for a single dyad.

Examples

Run this code
seq <- c(0.5, 0.6, 0.7, 0.6, 0.8, 0.7, 0.9, 0.8, 0.7, 0.8)
# Aggregate the sequence into 3 segments
agg_3 <- agg_seq(seq, 3)
print(agg_3)

# Aggregate the sequence into 5 segments
agg_5 <- agg_seq(seq, 5)
print(agg_5)

Run the code above in your browser using DataLab