Skip to content

Instantly share code, notes, and snippets.

@geofferyzh
Created April 16, 2012 18:16
Show Gist options
  • Save geofferyzh/2400460 to your computer and use it in GitHub Desktop.
Save geofferyzh/2400460 to your computer and use it in GitHub Desktop.
RinAction - R Importing Data - DBMS
#################################################
# Import data from DBMSs #
#################################################
# The ODBC Interface
library(RODBC)
myconn <-odbcConnect("mydsn", uid="Rob", pwd="xxxxxx")
crimedat <- sqlFetch(myconn, Crime)
pundat <- sqlQuery(myconn, "select * from Punishment")
close(myconn)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment