> Hi,
>
> I have a table for an 1 week exam result for many classes in school,
> like
> this:
>
>       Day       Class_ID  Test    Result
> 1   Monday    1                  Paper Passed
> 2   Tuesday    1                  Oral   Passed
> 3   Friday       1                  Paper  Passed
> 4   Monday    3                  Paper Passed
> 5   Sunday     3                  Oral   Passed
> 6   Monday    3                  Paper Passed
> 6   Sunday     3                  Paper Passed
>
> How can I sum the Word "Passed" from Result column ( for earch
> Class_ID and
> each Test), so i can get this following table:
>
>
>     Class_ID  Test          Passed_Count
> 1     1            Paper           2
> 2     1            Oral             1
> 3     3            Oral             1
> 4     3            Paper           3

Hi,

Use sqldf package. Select count grouping by desired columns.

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to