Challenge: Grouped Means with tapply
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
Takk for tilbakemeldingene dine!
single
Spør AI
Spør AI
Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår
Can you explain this in simpler terms?
What are the main points I should remember?
Can you give me an example?
Fantastisk!
Completion rate forbedret til 5.56
Challenge: Grouped Means with tapply
Sveip for å vise menyen
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
Takk for tilbakemeldingene dine!
single