[R] RSQLite to input dataframe

Amy Milano
Tue, 04 Jan 2011 10:43:36 -0000

Dear r helpers,

At first, I apologize for raising a query which seems to be a stupid
interpretation on my part. I am trying to learn SQLite.



Following is an example given in the RSQLite.zip file (Page # 4)

drv <- dbDriver("SQLite")
tfile <- tempfile()
con <- dbConnect(drv, dbname = tfile)
data(USArrests)
dbWriteTable(con, "arrests", USArrests)


On the similar line I am trying to read my data.

Suppose I have a dataframe as given below.

DF = data.frame(X = c("US", "UK", "Canada",
"Australia", "Newzealand"), Y = c(52, 36, 74, 10, 98))

drv <- dbDriver("SQLite")
tfile <- tempfile()
con <- dbConnect(drv, dbname = tfile)
data(DF)
dbWriteTable(con, ......., .......) # Didn't know what to write here.

I understand I have raised a query in a stupid manner. I need to understand is
there any way I can use SQLite to read
 dataframe or for that matter any csv file say e.g. 'DF.csv'.

Please enlighten me.

Amy



	[[alternative HTML version deleted]]