Create a variable called myage and assign it the value of your age.
myage = 21
2. Create a vector called grades containing the following values: 88, 92, 75, 99, and 80.
grades = c(88, 92, 75, 99, 80)
3. Using indexing, print the third element of the grades vector to the console.
print(grades[3])
4. Create a data frame called student_info containing the following columns: Name, Age, Gender, Grade. The data should be as follows:
Names = c("John", "Emily", "Michael", "Jessica")
Age = c(20, 22, 19, 21)
Major = c("AgBiz", "ENRE", "ENRE", "AgBiz")
Absent = c(TRUE, TRUE, FALSE, FALSE)
student_info = data.frame(Name=Names [1:4], Age, Major, Absent)
print(student_info)
5. Download the Supermarket Sales data in csv format to a known location on your machine. The dataset should be called supermarket_sales.csv. Using the setwd() function, set your working directory to the location where you have a file called supermarket_sales.csv
getwd()
setwd("C:/Users/brand/OneDrive/Documents/Spring 2023/AREC 330/Problem Set 1/supermarket_sales.csv")
6. Using the read.csv() function, read in the file supermarket_sales.csv and assign it to an object called mydata.
mydata <- read.csv("supermarket_sales.csv")
view(mydata)
7. Install and load the package readr.
install.packages("readr")
library(readr)
8. Write a brief explanation of what you did in steps 1-7 and how it relates to the tutorial.
In the following R coding exercise, I created of a series of variables and vectors in order to construct a data frame that organized students and summarized their age, undergraduate major, and attendance standing, as well as to import an excel file to utilize for further analysis. In step one, I created a variable that represented my personal age of 21. In lines 2 through 7, with the exception of 3, I created a series of vectors that I later was able to organize into a data frame in line 8. The data frame was a 4 column, 5 row table that listed a series of characteristics in which a group of students identified. Lines 3 and 9, were verifications of my vector specifications in printed format. Moving onto line 10, I asked R to acquire my current working directory to which I could then modify to incorporate and read an additional file, supermarket_sales.csv, in line 11. In line 12 I asked the computer to read the comma-separated values (csv) file and specifically to assign the data as "mydata". Lastly, my final line of code was done in order to install and load the package "readr". These steps related to the tutorial by providing me with a basic understanding of the R Studio and R Software platforms and by allowing me to create variable data and use it in a constructive manner.
Visit Tableau for students and apply for your 1-year academic license. Take a screenshot of the start of your confirmation email (up until Welcome to Tableau for Students.). DO NOT include the Product Key.
2. 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.
3. 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.
Tableau Public Link: https://public.tableau.com/app/profile/brandon.dodd