I'd like to use R to count a particular item out of it.

Asked 2 years ago, Updated 2 years ago, 33 views

Subjects specialized in class
1A Language
2A Mathematics 3B Language
4C Mathematics 5 C Mathematics 6C Language
7C Language

I'd like to show the number of people who are good at Korean by group from this chart.

A1
B1
C2

I would like to get answers like this.
How should I write it?

r

2022-09-30 11:22

1 Answers

using dplyr
library(dplyr)
df%>%filter (Favorite subject == 'Korean')%>%
    group_by%>%summarize(Count=n())
# # Atible: 2 x 3
#     class count
#   <fctr><int>
# 1 A 1
# 2B1
# 3C2

How about


2022-09-30 11:22

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.