The Following lines in R calls a stored procedure in SQL SEREVR
library(RODBC)
conn <- odbcDriverConnect('driver={SQL Server};server=HostName;database=DatabaseName;uid=useName;pwd=Password')
query <- paste("exec dbo.R_getData ");
res<-sqlQuery(conn, query);