course content

Course Content

R Introduction: Part II


Let's consolidate acquired knowledge with a practical task!


If you want to multiply each element of the row to a specific value (i.e., not one number for all elements), you need to have the condition: the number of rows of the matrix equals the multiplying vector length satisfied.


You have the selling data for a local furniture store stored in the sellings matrix.

MonthSofaArmchairDining tableDining chairBookshelf

And vector of prices named prices.

SofaArmchairDining tableDining chairBookshelf

Your tasks are:

  1. Output the total number of items sold each month.
  2. Transpose of the sellings matrix and reassign the result to the sellings variable.
  3. Find out revenue by each good by multiplying sellings and prices. Save the result to the income variable.
  4. Output the monthly revenues.
  5. Output the total three months' revenue.

Everything was clear?

Section 1. Chapter 7
toggle bottom row