Are you talking about "sql code chunks" when you say "sql scripts" in RStudio? Info about that is in in the first link above section 2.7.3. That's Section "2.7.3 SQL from Yihui Xie's new book "R Markdown."
I often copy and paste SQL scripts from Microsoft SQL Server Management Studio directly into RStudio code chucks, but I could directly edit the SQL in RStudio, too. You can run an SQL code chunk just like any other R code chunk.
I enclose all my SQL chunks between dbConnect and dbDisconnect statements. The variable assigned from the dbConnect is the one you pass to the connection parameter in the sql code chunk. The output.var in the sql chunk receives the results from the SQL query that you can manipulate in R.