createdna: Create DNA sequence

View source: R/create_dna_sequence.R

creatednaR Documentation

Create DNA sequence

Description

This function use two basic function: sample and paste0, here are interpretation respectively. Sample instructs R to randomly select a number of bases (which you give as "dna_length" input) between "A,T,C,G", with replacement. Sampling with replacement simply means that each number is “replaced” after it is selected, so that the same base can show up more than once. Since what you sample on one time shouldn’t affect what you sample on any of the others. Through sample function we get a list of bases with length you want, now use paste0 to change list into string, then you get real dna sequence.

Usage

createdna(dna_length)

Arguments

dna_length

A integer, the length of DNA you want to create.

Value

Random DNA sequence of specified length


rforbiodatascience22/group_1_package documentation built on April 5, 2022, 7:51 p.m.