The function install.packages('NAMED_PACKAGE') is an R function that installs NAMED_PACKAGE. While the function install_tensorflow() is a function in the tensorflow package to Install TensorFlow And Its Dependencies. I think you got your installation instructions a little mixed up.
Here's a step by step guide.
https://tensorflow.rstudio.com/installation/