I have a randomly generated sample of numbers. I would like to get the mean and standard deviation from this sample. I would also like to program this in a way where I don’t have to repeat myself. Here is what I could do vs. what I wish I could do. Does anybody know of a function that could do this for me?
set.seed(123) mean(sample(1:6,10000,replace=T)) sd(sample(1:6,10000,replace=T)) # vs. set.seed(123) sample(1:6,10000,replace=T) %>% summarise(mean = mean(), sd = sd())