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

bookChallenge: Grouped Means with tapply

Tâche

Swipe to start coding

You are given a data frame with students' scores in three subjects and their class group. Complete the following steps:

  • Use vapply to calculate the median score for each subject (math, english, science).
  • Use tapply to compute the mean math score for each group (X and Y).

Store your results in variables named subject_medians (for the vapply result) and group_math_means (for the tapply result).

Solution

Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 3. Chapitre 4
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

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: Grouped Means with tapply

Glissez pour afficher le menu

Tâche

Swipe to start coding

You are given a data frame with students' scores in three subjects and their class group. Complete the following steps:

  • Use vapply to calculate the median score for each subject (math, english, science).
  • Use tapply to compute the mean math score for each group (X and Y).

Store your results in variables named subject_medians (for the vapply result) and group_math_means (for the tapply result).

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 4
single

single

some-alt