stringr Functions

Use the character functions from the package stringr to print the following strings.

  1. "atgcatgcatgcatgcatgcatgcatgcatgcatgcatgcatgcatgcatgcatgcatgc". Do this by duplicating “atgc” 15 times.
  2. " Thank goodness it's Friday" without the leading white space (i.e., without the spaces before "Thank").
  3. "gcagtctgaggattccaccttctacctgggagagaggacatactatatcgcagcagtggaggtggaatgg" with all of the occurences of "a" replaced with "A".
  4. Print the length of this dna sequence "gccgatgtacatggaatatacttttcaggaaacacatatctgtggagagg".
  5. The number of "a"s in "gccgatgtacatggaatatacttttcaggaaacacatatctgtggagagg".
  6. Print the first 20 positions of this dna sequence "gccgatgtacatggaatatacttttcaggaaacacatatctgtggagagg".
  7. Print the last 10 positions of this dna sequence "gccgatgtacatggaatatacttttcaggaaacacatatctgtggagagg".
[click here for output]