Basic sample function returns unused arguments

That's very strange.

From copying and pasting the code above I get (note: I show the dice object at the end, just so you can see that it runs):

dice <- sample(x=6, size=10, replace=TRUE)

#>  [1] 6 4 2 4 2 5 4 1 6 6

Created on 2018-09-11 by the reprex package (v0.2.0.9000).

Does this work for you in vanilla R, but not in RStudio? (see FAQ below for disambiguation)