Strings stringr functions (solution)

Exercise
Output solution

Code solutions for stringr Functions

  1. "atgcatgcatgcatgcatgcatgcatgcatgcatgcatgcatgcatgcatgcatgcatgc".
[1] "atgcatgcatgcatgcatgcatgcatgcatgcatgcatgcatgcatgcatgcatgcatgc"
  1. ” Thank goodness it’s Friday” without the leading white space
[1] "Thank goodness it's Friday"
  1. "gcagtctgaggattccaccttctacctgggagagaggacatactatatcgcagcagtggaggtggaatgg" with all of the occurrences of "a" replaced with "A"
[1] "gcAgtctgAggAttccAccttctAcctgggAgAgAggAcAtActAtAtcgcAgcAgtggAggtggAAtgg"
  1. Print the length of this dna sequence
[1] 50
  1. The number of "a"s in "gccgatgtacatggaatatacttttcaggaaacacatatctgtggagagg".
[1] 16
  1. Print the first 20 positions of this dna sequence "gccgatgtacatggaatatacttttcaggaaacacatatctgtggagagg"
[1] "gccgatgtacatggaatata"
  1. Print the last 10 positions of this dna sequence gccgatgtacatggaatatacttttcaggaaacacatatctgtggagagg
[1] "tgtggagagg"