Create a list named myList with the following four elements (with their names): 1. numbers: The even numbers from -30 to 30. 2. strings: Five
Create a list named myList with the following four elements (with their names): 1. numbers: The even numbers from -30 to 30. 2. strings: Five character strings a,b,c,d,e. 3. matrix: One 2x3 matrix 5 3 1 8 4 6 . 4. logical: Two logical values TRUE and FALSE. Print the sum of the numbers. Change the value of the last element of the strings as k. Change the matrix with its transpose. Remove logical from the list. Print the list. c. (15 pts) Monday Tuesday Wednesday Thursday Friday Week1 325 337 465 192 332 Week2 199 389 513 312 298 Week3 244 399 336 217 287 Store the daily sales of a product (given above) for three weeks in a matrix object. Assign the row names and column names as given in the table above. Compute and print the average sales of each week (row) and average sales of each day (column). Insert the sales on the weekend to the matrix using cbind function. Saturday Sunday Week1 262 229 Week2 223 148 Week3 412 403 Print the sales of Week1 and Week3 on Tuesday, Thursday, and Saturday as a submatrix.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started