Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lære Challenge: Sales and Revenue | Section
Practice
Projects
Quizzes & Challenges
Quizer
Challenges
/
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.

Oppgave

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.

Løsning

Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 1. Kapittel 33
single

single

Spør AI

expand

Spør AI

ChatGPT

Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår

close

bookChallenge: Sales and Revenue

Sveip for å vise menyen

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.

Oppgave

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.

Løsning

Switch to desktopBytt til skrivebordet for virkelighetspraksisFortsett der du er med et av alternativene nedenfor
Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 1. Kapittel 33
single

single

some-alt