Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lære Challenge: Matrix Row Means | Apply Family Functions in R
Practice
Projects
Quizzes & Challenges
Quizzes
Challenges
/
Control Flow in R

bookChallenge: Matrix Row Means

Opgave

Swipe to start coding

You are given three different data objects: a matrix of student scores, a list of monthly sales for stores, and a vector of product prices.

  • Use the apply function to find the highest score for each student (each row in the matrix).
  • Use the lapply function to calculate the total sales for each store in the sales_list.
  • Use the sapply function to round each price in prices to the nearest integer, and store the result in a variable called rounded_prices.

Store your results in variables named:

  • student_highest_scores for the highest scores per student;
  • store_total_sales for the total sales per store;
  • rounded_prices for the rounded product prices.

Løsning

Var alt klart?

Hvordan kan vi forbedre det?

Tak for dine kommentarer!

Sektion 3. Kapitel 2
single

single

Spørg AI

expand

Spørg AI

ChatGPT

Spørg om hvad som helst eller prøv et af de foreslåede spørgsmål for at starte vores chat

Suggested prompts:

Can you explain this in simpler terms?

What are the main points I should remember?

Can you give me an example?

close

bookChallenge: Matrix Row Means

Stryg for at vise menuen

Opgave

Swipe to start coding

You are given three different data objects: a matrix of student scores, a list of monthly sales for stores, and a vector of product prices.

  • Use the apply function to find the highest score for each student (each row in the matrix).
  • Use the lapply function to calculate the total sales for each store in the sales_list.
  • Use the sapply function to round each price in prices to the nearest integer, and store the result in a variable called rounded_prices.

Store your results in variables named:

  • student_highest_scores for the highest scores per student;
  • store_total_sales for the total sales per store;
  • rounded_prices for the rounded product prices.

Løsning

Switch to desktopSkift til skrivebord for at øve i den virkelige verdenFortsæt der, hvor du er, med en af nedenstående muligheder
Var alt klart?

Hvordan kan vi forbedre det?

Tak for dine kommentarer!

Sektion 3. Kapitel 2
single

single

some-alt