Challenge: 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
vapplyto calculate the median score for each subject (math,english,science). - Use
tapplyto compute the mean math score for each group (XandY).
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?
Tak for dine kommentarer!
Sektion 3. Kapitel 4
single
Spørg AI
Spørg AI
Spørg om hvad som helst eller prøv et af de foreslåede spørgsmål for at starte vores chat
Fantastisk!
Completion rate forbedret til 5.56
Challenge: 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
vapplyto calculate the median score for each subject (math,english,science). - Use
tapplyto compute the mean math score for each group (XandY).
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?
Tak for dine kommentarer!
Sektion 3. Kapitel 4
single