It works for me in a Windows 10 environment.
In what environment do you work ? Do you use RStudio?
And please give e.g. the output of sessionInfo().
I assume that you entered the three statements immediately after starting the R session?
If not try again in a 'clean' session .