Learn R Programming

baseq (version 0.1.4)

count_seq_pattern: Count frequency of a pattern in a sequence

Description

This function counts the frequency of a specific character or pattern in a given sequence.

Usage

count_seq_pattern(seq, pattern)

Value

An integer representing the count of the pattern in the sequence.

Arguments

seq

A character vector representing the sequence to count the pattern in.

pattern

A character string representing the pattern to count in the sequence.

Examples

Run this code
seq <- "ATGGTGCTCCGTGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCTACGTAG"
count_seq_pattern(seq, "CG")
# [1] 31

Run the code above in your browser using DataLab