Hello, I have an education dataset and I'd like to know how to count the number of courses each student has taken in a particular subject. For instance, say the course codes for "History" are 20-26 & 31 and I have the following data
Student ID Course Code 1 16 1 17 1 21 1 31 2 10 2 22 2 23 2 24 I would like a separate variable that reads like this Student ID Hist Courses 1 2 2 3 I've read other "count" tutorials on the forum, but couldn't still find an answer to my problem. Thanks for helping out! Greg -- View this message in context: http://n4.nabble.com/Count-variables-by-ID-tp1476618p1476618.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ 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.