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:
- sample function
sample()
- length function
length()
- names function
names()
- rounding functions like ceiling or floor.
ceiling(), floor()
- lists
list()
- for loops
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:
sample()length()names()ceiling(), floor()list()