# load the tidyverseModule 2, Assignment 3: Final Project Kickoff
Assignment Description
Purpose
The goal of this assignment is to get started working on the final project for the course.
Task
Choose a dataset to work with for the final, write a research question, summarize and plot the data.
Criteria for Success
- Code is within the provided code chunks
- Code chunks run without errors
- Code produces the correct result
- Code that produces the correct answer will receive full credit
- Code attempts with logical direction will receive partial credit
- Written answers address the questions in sufficient detail
Assignment Questions
All questions are worth 1 point unless otherwise specified.
Explore Datasets
Click on the links for each dataset and read a little bit about each one.
- KrillBase
- Fur Seal Pups at Maiviken
- Gentoo Penguins on Bird Island
- Chinstrap Penguins on Signy Island
Now that you have an idea of what each data set is about, let’s explore the actual data.
First, we need to load the tidyverse package.
Read all four datasets (.csv files) into RStudio using the read_csv() function (not read.csv). Remember to save each dataset as an object with a descriptive name. The four files are:
krill.csvfur_seals.csvgentoos_and_temps.csvchinstraps_on_signy.csv
- Use a function (e.g.,
head()orstr()) to look at the data in each data frame.
Choose Your Dataset
- Now that you’ve explored the datasets, decide which one you would like to focus on for the final project. Below, tell us which one and why you find it interesting.
Answer:
Modifications
Find your dataset below.
We’ve made a few modifications to each of the datasets to make them a bit more manageable to work with. Based on how some of these variables will be used in future assignments, you should treat certain variables in the way listed below (even if they could be considered either numeric or categorical).
Krill
- You will want to use the
Krill_per_1m2_logcolumn as your dependent variable. This is a log-transformed version of theKrill_per_1m2column. You don’t need to worry about why we transformed the data, but this column should be a bit easier to work with. - The
Date,Year, andMonthcolumns should all be treated as numeric variables. - While the
Stationcolumn can technically be considered a qualitative/categorical variable, please use theDay_Nightcolumn as your qualitative/categorical variable for this assignment and for your research question.
Fur Seals
- If you choose to use the
DateorYearcolumn, treat them as numeric variables. - On the other hand, if you use the
Monthcolumn, treat it as a categorical variable.
Gentoo Penguins
- If you are using the
Yearcolumn, treat it as a numeric variable. - The dataset has a column for the previous year’s December temperature. Because counts of chicks took place in January or February (and nests were counted in October/November), the number of chicks is most likely to be related to the temperatures directly after chicks hatched (December of the previous year).
Chinstrap Penguins
- We do not recommend using the
MONTHorDAYcolumn. - If you use the
YEARcolumn, treat it as a numeric variable.
Writing a Research Question
For each of the columns in your dataset, identify whether they contain categorical or numeric data.
NOTE! Some data, such as dates (month, year), can act as both types of data. See the section above for clarification about columns in your chosen dataset.
Type out the name of the column and then the descriptor. For example:
- island_name: categorical
- island_size_km: numeric
Answer:
In order to write a successful research question, we need to identify our dependent variable and the independent variable that we think affects the dependent variable.
- First, determine which variable is the dependent variable in your dataset. Remember, it must be numeric.
Answer:
- Next, choose 1 independent variable from your dataset (each dataset has more than one from which to choose). This should be a variable that you believe might affect the values of the dependent variable. It can be either categorical OR numeric.
Answer:
- Now, let’s put those 2 variables into a research question (revisit the Aquaponics lesson for a reminder of how to write a research question).
Answer:
Summarize the Data
Let’s get to know our data a little better.
- Focus on your dependent variable. Calculate the minimum value (
min()), maximum (max()) value, and average (mean()) value using thetidyversefunctions (you might needna.rm = TRUE!).
- If your research question has a categorical independent variable, use the
group_byfunction to find the above values of your dependent variable for each category of the independent variable - If your research question has a numeric independent variable, calculate the minimum, maximum, and mean values for the independent variable in addition to the dependent variable
Plot the Data
Important Instructions and Info!
You can use any variable from the dataset, not only the ones in your research question. In fact, you will need to use different variables to successfully create all of the plots.
For all of the plots below, be sure to add:
- improved labels for the x-axis, y-axis, and the legend (if present)
- one of the following themes to your code:
theme_bw,theme_classic, ortheme_light.
For each question, you get to choose the variables you use for each plot! Pay attention to which variables are numeric vs. categorical and where they should go in the code to produce the correct type of plot.
Because you are choosing your own variables, there is no answer key for this assignment.
Each plot is worth 2 points. Your interpretation is worth 1 point. Some of your plots may be hard to interpret. That’s ok! In that case, explain why the plot is challenging to interpret.
STOP! Did you read the “Important Instructions and Info” section above?
Produce a histogram plot (just one, not multiple on the same plot).
Write 1-2 sentences describing what information you can gather from the plot. (2 points for plot, 1 for description)
Answer:
Create a multiple histogram plot. Make sure we can see each histogram plot (make sure one isn’t blocking another by modifying the transparency and position).
Write 1-2 sentences describing what information you can gather from the plot. (2 points for plot, 1 for description)
Answer:
Create a box-and-whisker plot. Changing the color of the boxes is optional. Make sure to add points to the plot.
Write 1-2 sentences describing what information you can gather from the plot. (2 points for plot, 1 for description)
Answer:
Create a scatter plot.
Write 1-2 sentences describing what information you can gather from the plot. (2 points for plot, 1 for description)
Answer:
- Do any of the plots you made above match up with your research question?
- If so, identify which plot and explain how you know it matches up correctly (based on numeric vs. categorical variables).
- If not, explain which plot type would match your research question and how you know (based on numeric vs. categorical variables).
Answer:
Turning in Your Assignment
- Make sure your name is filled in at the top of the document.
- Click the Render button at the top of this document. This will produce an HTML file that opens in a new tab and also saves to the Files panel on the bottom-right of your screen.
- To download the HTML file from Posit Cloud, click the empty box to the left of it in the Files panel.
- Click the blue gear at the top of the Files panel and choose Export.
- Put your last name at the front of the file name when prompted, then click Download. The file is now in your Downloads folder.