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

bookChallenge: Matrix Row Means

Tarea

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.

Solución

¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 3. Capítulo 2
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: Matrix Row Means

Desliza para mostrar el menú

Tarea

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.

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 3. Capítulo 2
single

single

some-alt