Question: This project involves working with equations and assignment statements and with data structures. You will use RMarkdown and knit to generate output. You want to

This project involves working with equations and assignment statements and with data structures. You will use RMarkdown and knit to generate output. You want to include the questions with the results as well as the r code.
Write the r code that carries out the equations. Show the results from using the equations with the data given
6. Create a copy of the result array calling it new.result
Add 10 to the element in the row 3, column 2, and matrix 2.
Multiply every element in matrix 1 by 2
7. Make a copy of vector 2 calling it vector2a
Change the third item in vector2a to 15.
Multiply the sixth item in vector2a times the first item in vector1 and assign the result to a variable called vmult
Assume the following:
# Create the data frame.
emp.data <- data.frame( emp_id = c (1:5), emp_name = c("Rick","Dan","Michelle","Ryan","Gary"), salary = c(623.3,515.2,611.0,729.0,843.25), start_date = as.Date(c("2012-01-01","2013-09-23","2014-11-15","2014-05-11","2015-03-27")), stringsAsFactors = FALSE )
8. Create a data frame that is made up of the emp_id and the salary columns.
Do the same using numeric indexing instead of the column names.
9. Create a data frame that contains all rows where the salary is greater than 700 with only one line of code.
Assume you have the data frame set up
Hint - use indexing and relational operator (where salary>700) determines the rows selected
This is known as subsetting
Assume:
# Create the first data frame.
emp.data <- data.frame( emp_id = c (1:5), emp_name = c("Rick","Dan","Michelle","Ryan","Gary"), salary = c(623.3,515.2,611.0,729.0,843.25), start_date = as.Date(c("2012-01-01","2013-09-23","2014-11-15","2014-05-11","2015-03-27")), dept = c("IT","Operations","IT","HR","Finance"), stringsAsFactors = FALSE )
# Create the second data frame
emp.newdata <- data.frame( emp_id = c (6:8), emp_name = c("Rasmi","Pranab","Tusar"), salary = c(578.0,722.5,632.8), start_date = as.Date(c("2013-05-21","2013-07-30","2014-06-17")), dept = c("IT","Operations","Fianance"), stringsAsFactors = FALSE )
# Bind the two data frames add rows
emp.finaldata <- rbind(emp.data,emp.newdata)
10. Create a data frame that does not include the emp_name column.
Correct the error for the dept name of one of the employees.
Add a new column called role which indicates which employees are managers (Rick, Ryan, and Pranab) and which are staff (Dan, Michelle, Gary, Rasmi, and Tusar
Deliverables
RMD file output
.rmd file

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!