Learn R Programming

RBioinf (version 1.32.0)

randDNA: A function to generate random DNA sequences.

Description

This function generates random DNA sequences, nucleotides are sampled with frequency 0.25 each.

Usage

randDNA(n)

Arguments

n
The length of the sequence desired.

Value

A length one character vector, with n characters randomly chosen from A, C, T and G.

Details

This function generates random sequences of A, C, T and G. Real DNA is quite different, so one should not use these sequences for much other than pedagogical purposes.

Examples

Run this code
randDNA(100)

Run the code above in your browser using DataLab