Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprende 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.

Tarea

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.

Solución

¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 1. Capítulo 33
single

single

Pregunte a AI

expand

Pregunte a AI

ChatGPT

Pregunte lo que quiera o pruebe una de las preguntas sugeridas para comenzar nuestra charla

close

bookChallenge: Sales and Revenue

Desliza para mostrar el menú

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.

Tarea

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.

Solución

Switch to desktopCambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 1. Capítulo 33
single

single

some-alt