Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Apprendre Challenge: Matrix Row Means | Apply Family Functions in R
Control Flow in R

bookChallenge: Matrix Row Means

Tâche

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.

Solution

Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 3. Chapitre 2
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: Matrix Row Means

Glissez pour afficher le menu

Tâche

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.

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 3. Chapitre 2
single

single

some-alt