From e5551232afac7f8c9311c447b95a88c65e4ce3bd Mon Sep 17 00:00:00 2001 From: Siobhan Schenk <35807279+siobhanschenk@users.noreply.github.com> Date: Thu, 22 Feb 2024 09:52:45 -0800 Subject: [PATCH] Update package_examples.md --- content/package_examples.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/content/package_examples.md b/content/package_examples.md index 0daf421..8fbc62f 100644 --- a/content/package_examples.md +++ b/content/package_examples.md @@ -84,9 +84,9 @@ Spend the next 5 minutes removing and editing parts of this plot code to figure ## stringr and lubridate -stringr is a package that let's you easily manipulate character data. For the full resources go to their website. +stringr is a package that let's you easily manipulate character data. For the full resources go to their website. -lubridate is meant to help R users format date and time data, which are actually a huge pain to work with in R. lubridate even lets you deal with extra annoying things, like daylights savings time in your multi-year datasets. For the full resources go to their website. +lubridate is meant to help R users format date and time data, which are actually a huge pain to work with in R. lubridate even lets you deal with extra annoying things, like daylights savings time in your multi-year datasets. For the full resources go to their website. Today, we are not exploring dates and times, but we are using the character vector manipulation part of lubridate. @@ -182,8 +182,8 @@ sequences.that.match = intersect(seq74trim, seq32) ``` The point of this example is to show why `str_sub` is different from `str_replace`: -`str_sub` **counts** to extract information. -`str_replace` looks for **perfect matches** and does something with those perfect matches. +
`str_sub` **counts** to extract information.
+`str_replace` looks for **perfect matches** and does something with those perfect matches.
In situations where you have different string of letters (like in many DNA sequences), using perfect matches to extract a subset of your data for further analysis, like merging with other DNA sequences, is not possible because it is not reasonable to type out hundreads of sequences manually and look for matches that way.