Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Apprendre Challenge: Sales and Revenue | Section
Essential R Programming for Absolute Beginners - 1768563985826

bookChallenge: Sales and Revenue

Note
Note

If you want to multiply rows (or columns) by different values, the length of the vector you use must match the number of rows (or columns) in the matrix. This ensures that each row (or column) element is multiplied by the corresponding value.

Tâche

Swipe to start coding

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

MonthSofaArmchairDining tableDining chairBookshelf
March1621302310
April4039132116
May1121363216

And a vector of prices named prices:

SofaArmchairDining tableDining chairBookshelf
34015011545160

Your tasks are:

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

Solution

Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 1. Chapitre 33
single

single

Demandez à l'IA

expand

Demandez à l'IA

ChatGPT

Posez n'importe quelle question ou essayez l'une des questions suggérées pour commencer notre discussion

close

bookChallenge: Sales and Revenue

Glissez pour afficher le menu

Note
Note

If you want to multiply rows (or columns) by different values, the length of the vector you use must match the number of rows (or columns) in the matrix. This ensures that each row (or column) element is multiplied by the corresponding value.

Tâche

Swipe to start coding

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

MonthSofaArmchairDining tableDining chairBookshelf
March1621302310
April4039132116
May1121363216

And a vector of prices named prices:

SofaArmchairDining tableDining chairBookshelf
34015011545160

Your tasks are:

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

Solution

Switch to desktopPassez à un bureau pour une pratique réelleContinuez d'où vous êtes en utilisant l'une des options ci-dessous
Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 1. Chapitre 33
single

single

some-alt