You could try looking through this resource: https://db.rstudio.com
You should be able to set up an odbc connection for MS SQL Server from there: https://db.rstudio.com/odbc/
After installing packages correctly you should be able to do something like:
rsqlserver <- dbConnect(RSQLServer::SQLServer(), server = "SQLServer")
Otherwise try the instructions found here: https://db.rstudio.com/databases/microsoft-sql-server/
See if you can get any of this stuff to work and I'd be happy to help more from there!
For package installation I would think this should do the trick:
install.packages("DBI")
install.packages("RODBCDBI")
library(DBI)
library(RODBCDBI)