the above answers are technically correct:
sample(a,1)
however, if you would like to repeat this process many times, let's say you would like to imitate throwing a dice, then you need to add:
a<-c(1,2,3,4,5,6)
sample(a, 12, replace=TRUE)
Hope it helps.