View source: R/MakeSQLTempTable.R
MakeSQLTempTable | R Documentation |
Copy an R data frame into Microsoft SQL Server as a temporary table which can then be used to query other SQL tables
MakeSQLTempTable(chan, data, tbl_name, columns, dtypes)
chan |
the ODBC channel |
data |
the data frame to copy to SQL |
tbl_name |
the desired temporary table name, without the pound sign passed as a string |
columns |
the columns from data wished to be copied. To be passed as a vector of strings. |
dtypes |
the data types of those columns. Also to be passed as a vector of strings. |
library(RODBC) chan <- odbcConnect("AthensSql") # if pulling data from Bedmaster, all dates should be unix epochs, which is just an integer. MakeSQLTempTable(chan, data, tbl_name="patients", columns=c("MRN", "Test_Date"), dtypes=c("integer", "integer"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.