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

bookChallenge: Grouped Means with tapply

Opgave

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).

Løsning

Var alt klart?

Hvordan kan vi forbedre det?

Tak for dine kommentarer!

Sektion 3. Kapitel 4
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

close

bookChallenge: Grouped Means with tapply

Stryg for at vise menuen

Opgave

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).

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

single

some-alt