Learn R Programming

AnimalSequences (version 0.2.0)

sequence_length_summary_element: Summarize Sequence Lengths by Element

Description

This function calculates summary statistics for the lengths of sequences containing specific distinct elements. It performs the summary for each distinct element found across the sequences.

Usage

sequence_length_summary_element(sequences)

Value

A data frame with the following columns:

element

The distinct element.

mean_seq_elements

The mean length of sequences containing the element.

sd_seq_elements

The standard deviation of the lengths of sequences containing the element.

median_seq_elements

The median length of sequences containing the element.

min_seq_elements

The minimum length of sequences containing the element.

max_seq_elements

The maximum length of sequences containing the element.

distinct_elements

The number of distinct elements in sequences containing the element.

pvalue_distinct_elements

The p-value comparing the true number of distinct elements to shuffled sequences.

Arguments

sequences

A character vector where each element is a sequence of elements separated by spaces.

Examples

Run this code
sequences <- c('hello world', 'hello world hello', 'hello world hello world')
sequence_length_summary_element(sequences)

Run the code above in your browser using DataLab