I am taking a stats class and we are doing some pretty basic things in R. I just reinstalled R+RStudio because my sample function wasn't working correctly and it still fails after a full reinstallation. Here is the code and error:
dice <- sample(x=6, size=10, replace=TRUE)
Error in sample(x = 6, size = 10, replace = TRUE) :
unused arguments (x = 6, size = 10, replace = TRUE)
It should be a simple line of code that "rolls" a dice (the values being 1-6) and does it 10 times. Does anyone know why it won't take any of the arguments?
Under the "Help" tab after I type ?sample it tells me:
sample(x, size, replace = FALSE, prob = NULL) are the necessary requirements - I'm using them yet still get the unused arguments error. What do I do?