library(RODBC)
con <- odbcDriverConnect("driver={Sql Server};server=servername;trusted connection=true")
dat <- sqlQuery(con, "select * from table");
close(con)
This will connect to a SQL Server instance. For more information on what your connection string should look like, visit connectionstrings.com
Also, since there's no database specified, you should make sure you fully qualify the object you're wanting to query like this databasename.schema.objectname