This assignment is modified from the decodeR exercises by Kelly Bodwin and Allison Theobold.
Once you finish this assignment, think about how you might decode the message in python. For +5 extra credit, write python code that decodes the message, following the outline of the R code you’ve already written.
In this assignment, you will be creating and manipulating vectors, lists, and data frames to uncover a top secret message.
Some advice:
Work with those around you
Google is your friend! If an error is confusing, copy it into Google and see what other people are saying. If you don’t know how to do something, search for it.
Just because there is no error message doesn’t mean everything went smoothly. Use the console to check each step and make sure you have accomplished what you wanted to accomplish.
Part One: Setup
Each of the following R chunks will cause an error and/or do the desired task incorrectly.
Find the mistake, and correct it to complete the intended action.
For each error, write 1-2 sentences to reflect on what the mistake was and how you found it and fixed it.
Create vectors containing the upper case letters, lower case letters, and some punctuation marks.
Checkpoint: Headquarters has informed you that at this stage of decoding, there should be 352 numbers in the secret message that are below 17.
Turn your vector of numbers into a matrix with 5 columns.
Separately from your top secret numbers, create a vector of all the even numbers between 1 and 382. Name it “evens”. That is, “evens” should contain 2, 4, 6, 8 …, 382.
Subtract the “evens” vector from the first column of your secret message matrix.
Subtract 100 from all numbers in the 18-24th rows of the 3rd column.
Multiply all numbers in the 4th and 5th column by 2.
Turn your matrix back into a vector.
Checkpoint: Headquarters has informed you that at this stage of decoding, all numbers in indices 500 and beyond are below 100.
Take the square root of all numbers in indices 38 to 465.
Round all numbers to the nearest whole number.
Replace all instances of the number 39 with 20.
Checkpoint: Headquarters has informed you that your final message should have 344 even numbers.
Part 3: The secret message!
Use your final vector of numbers as indices for my_symbols to discover the final message!
Google the first line of this message, if you do not recognize it, to see what it is.
Write 3-4 sentences about what you learned from this investigation. What problems did you encounter, and how did you solve them?