Introduction
Please submit your answers as both an RMD file and .html file
This assignment is due on October 6, 2017. It is a seriously graded assignment, so please do not use other students outside class as a reference. We will work together on some of them in class however, take full advantage of this time. If you find that you got useful help from another student, please give attribution. All answers to these questions can be answered using the contents of Chapter 14 of R for Data Science.
Exercises
- There is a database of words in the package stringr called ‘words’. Use it to find all words that:
- Start with q
- End with j
- Are exactly 3 letters long.
- Have 8 letters or more.
- Still using
words
- Write a regular expression to find all words that end with a vowel.
- Write a regular expression to find all words that begin with ‘ex’ but not with ‘exe’.
- A)Write the equivalents of
?, +, and * in {m,n} form.
- Write a regular expression to find all words in
words that begin with 2 vowels in a row.
- write a regular expression to find all words with three or more consonants in a row.
4.Still using words:
- Find a regular expression that finds all words that begin or end with x.
- Find all words that begin with a consonant and end with a vowel.
- Find all words that contain at least one of each different vowel (aeiou).
- Find all words that have the five vowels appearing in the word in alphabetical order.
- Textbook 14.4.3.1 #1, #2 parts 1 and 2 only.
Switch the first and last letters of all words in words and save the result as sordw.
Which members or sordw are words?
- Textbook 14.4.6.1 #1,2,3
- Find the five most common words in
sentences. (This may take some work.)