h4sci / h4sci-tasks

Tasks and Exercises
7 stars 0 forks source link

Block 2, Task 1: Create a Program to Assign Students to Groups #5

Open mbannert opened 4 years ago

mbannert commented 4 years ago

Create a program to assign students to groups. Assign a type of card and a color (clubs, spades, hearts, diamonds) to each student. Make sure to have equally sized groups as much as possible.

Create a reproducible example to show how your code works.

Bonus: Use the GitHub API to get usernames from github. If you submit your work before the next session, it will help to give you feedback and discuss the code.

Note: This task is a little harder and a bit less of a Mickey Mouse example in the sense that splitting up actually makes sense. Someone on the team could read through the github documentation and figure out how to extract usernames from the API. 1-2 others could think of the problem itself.

Hint:

The following ingredients can be handy to implement the above in R:

mbannert commented 1 year ago

To skip the GitHub API part for starters, generate a vector of student names, e.g.,

nms <- paste("student", c(LETTERS,letters)[1:33], sep = " ")