Create an algorithm and a code in R for the following problem:
Each member of a group of n players rolls a die. Find the mean and variance of the total