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 |
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
Using the
read.csv()
function, read in the filesupermarket_sales.csv
and assign it to an object calledmydata
.Install and load the package
readr
.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 (although there are many more - see handout): 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
You should create a new webpage on your google site titled Problem Set 1
. This webpage should include your responses to both Parts 1 and Parts 2 of the problem set. Part 1 should display the contents of your log file generated when you source your R script and your answer to question 8 in paragraph form. Review the instructions in the lab to see how to generate the log file. Part 2 should contain your evidence of completing steps 1 & 2 and a link to your Tableau Public site. Submit the link to your google site webpage in Canvas.