Learn R Programming

AnimalSequences (version 0.2.0)

element_position: Calculate Median Position of Each Element in Sequences

Description

This function calculates the median position of each element across sequences, summarizes the distribution, and compares it to a shuffled distribution.

Usage

element_position(sequences, n_permutations = 1000)

Value

A data frame with the median position, standard deviation, expected position, effect size, and p-value for each element.

Arguments

sequences

A character vector of sequences to analyze.

n_permutations

The number of permutations to use for the null distribution.

Examples

Run this code
# Example usage:
sequences <- c("A B C", "A B", "A C", "B C", "A B C D")
result <- element_position(sequences)
print(result)

Run the code above in your browser using DataLab