# Exercise 1 ###### tags: `exercise` ## Instructions - Before attempting this exercise, please review the [R Tutorial](https://hackmd.io/@ColbyBI377/Rtutorial). You may also refer to any of there several online [guides to Markdown](https://www.markdownguide.org/). - Below are *Problems* which should all be achievable using the information in the tutorial. *Challenges* will require you to find resources or answers on your own. (Hint: Try googling "how to ... in R".) - **Create a HackMD note to share your answers** to these prompts. Copy the prompts, add your code and explanatory text and images. Use markdown formatting to distinguish the prompts from the code and explanatory text of your answers. - **Please complete this assignment individually**. Discussing the problems with others is acceptable. However, keep in mind that your goal here should be to build a skill you can use going forward. Copying code you don't understand will not help you in the long run! - Submit your answers by sharing the note with Dr. Angelini before Friday at dawn. --- ### Problem 1 Using the `ChickWeights` dataset, create boxplots showing log~10~ weights only on days zero (0), 10, and 20 of the experiment. The plot should have proper axis labels. #### Challenge 1a Have the figure display results for each diet separately. #### Challenge 1b With the figure features above, communicate both the individual values and the distribution of those values to a viewer. --- ### Problem 2 Randomly generate two vectors of 100 values each. Plot them against one another and draw a linear trend line through the group of points. #### Challenge 2a Find the slope of the line you've drawn above. #### Challenge 2b Add text to the plot, showing the slope. #### Challenge 2c Make that text with the slope's value held in a variable, rather than re-typing the digits by hand. And display only 4 significant digits. #### Challenge 2d Do the same thing using `ggplot`. --- ## Quick Links - [BI377 Moodle](https://moodle.colby.edu/course/view.php?id=33250) - [BI377 HackMD](https://hackmd.io/@ColbyBI377/landingpage) - [rstudo.colby.edu](https://rstudio.colby.edu/)