Hi,
I am a new learner of R. Creating a function to roll two virtual dice. The function should work like this: each time you call roll(), R should return the sum of rolling two dice. The code is as follows along with the error message:
roll<-function() {die<-1:6 dice<-sample(x=die,size=2,replace=TRUE) sum(dice)}
Error: unexpected symbol in "roll<-function() {die<-1:6 dice"
Appreciate guidance on the above issue.