Problem Set 1: Introduction to R and Tableau
Part 1: R
Create a variable called
myage
and assign it the value of your age.Create a vector called
grades
containing the following values: 88, 92, 75, 99, and 80.Using indexing, print the third element of the
grades
vector to the console.Create a data frame called
student_info
containing the following columns: Name, Age, Major, Absent. The data should be as follows:
Name | Age | Major | Absent |
---|---|---|---|
John | 20 | AgBiz | TRUE |
Emily | 22 | ENRE | TRUE |
Michael | 19 | ENRE | FALSE |
Jessica | 21 | AgBiz | FALSE |
Install and load the package
readr
.Download the Supermarket Sales Data in csv format to a known location on your machine. The dataset should be called
supermarket_sales.csv
. Using thesetwd()
function, set your working directory to the location where you have a file calledsupermarket_sales.csv
. Read the description of the supermarket sales data available in the Supermarket Sales Data Overview.Using the
read.csv()
function, read in the filesupermarket_sales.csv
and assign it to an object calledmydata
.Write a brief explanation of what you did in steps 1-7 and how it relates to the tutorial we did in class.
Part 2: Getting Started with Tableau
We will be using two Tableau products in this course: Tableau Desktop and Tableau Public. Tableau desktop typically requires a paid subscription, but as students (and teachers) we get it for free. Your assignment for this week is to be fully prepared to use these two Tableau products on your personal computer.
Visit Tableau Desktop and download Tableau Desktop using the 14-day free trial. You can enter your product license key once you receive an email with your academic license. Take a screenshot of Tableau Desktop open on your computer.
Visit Tableau Public and create an account. You will use this account to host your data visualizations, which you can then embed on your google site. You will be required to use this to upload homework assignments.
How to Submit
- Create a Webpage on Your Google Site:
- Title the new webpage Problem Set 1.
- This page should include your responses to Part 1 and Part 2 of the problem set.
- Include the Following Content:
Part 1:
- Display the contents of your log file, which you generated by sourcing your R script. (Refer to the lab instructions for guidance on creating a log file.)
- Write your answer to Question 8 in paragraph form.
Part 2:
- Provide evidence that you completed Steps 1 & 2 as described in the problem set.
- Include a link to your Tableau Public site where your work is published.
- Submit the Link to Your Google Site Page:
- Copy the URL of your Google Site webpage for Problem Set 1.
- Submit this link via Canvas.