
Assignment 01
INTRODUCTION TO CODING AND USING R
Copyright EPSY 5261, 2023
Instructions
Download the assignment01.zip folder and unzip it. This
You will use the films.csv data set to answer questions in this lab. The data codebook includes a description of how the data were collected and of each of the attributes included in the data.
Use the code chunks in the assignment01.qmd file to load packages and import the data. (Reference the in-class activity from Day 3 if you need to remember how to do this.) You can also do any computations needed for the assignment in this QMD document.
Questions
Submit a PDF document of your responses to the following questions.
Print the first 10 rows of the dataset to make sure it was imported correctly. Copy-and-paste (or screenshot) the output from this function into the document you will submit. If you copy-and-paste the output into your document, change the font to a monospaced font (e.g., Courier, Consolata).
What does a row represent in this data set?
What type of attribute is
duration(categorical or quantitative)? How can you tell?What type of attribute is
genre(categorical or quantitative)? How can you tell?Using the
df_stats()function, create a table of thegenreattribute and have it display proportions. Copy-and-paste (or screenshot) the output from this function into the document you will submit. If you copy-and-paste the output into your document, change the font to a monospaced font (e.g., Courier, Consolata).Based on the output from Question 5, what proportion of movies in this dataset are action movies?
Using the
df_stats()function, compute the summary statistics for thedurationattribute. Copy-and-paste (or screenshot) the output from this function into the document you will submit. If you copy-and-paste the output into your document, change the font to a monospaced font (e.g., Courier, Consolata).What is the mean movie duration? Write a single sentence interpreting this value in the context of the duration of the movie. (2pts.)
Create a histogram of the movie durations. (4pts.)
- Update the x- and y-axis labels.
- Color the bars and bar borders of the histogram.
- Insert a picture of the plot into your word-processed document. Re-size it so that it does not take up more room than necessary. (But, make sure the labels are still readable.)
Where is “most” of the data in your histogram? (Note: You can give your best guess here, but we will formalize this later in the semester) Interpret this in the context of the duration of the movie. (2pts.)
How do I submit the assignment?
Create a PDF of your responses and submit the PDF via email to both the instructor and TA. Also cc any group members. Before you submit the assignment check that: