Saturday, May 15, 2010

Less than a hundred

I congratulate myself. 100 lines of R code gets integrated Sql/R data management. Just operate an R session in the local Sqlite directory, load the 100 lines, and you are sqlite connected. All in a single web page of text.

The system is easy. Here is a sample R session in which I create a database,table, enter values and retrieve values.


> rm(list=ls(all=TRUE))
> dir()
[1] "r.dat" "sql.exe" "sql.r" "test.sql"
> source("C:\\R\\Work\\sql.r")
> db <- "mydata.db" > table <- "notes" > qcreate(table,db, "(n text)" )
> qm(db)
V1
1 notes
> qinsert(table,db,"(' Some notes')")
> qrl(table,db)
V1
1 Some notes
> rm(list=ls(all=TRUE))
> source("C:\\R\\Work\\sql.r")
> dir()
[1] "r.dat" "sql.exe" "sql.r" "test.sql"
> db <- "mydata.db" > table <- "notes" > qcreate(table,db, "(n text)" )
> qinsert(table,db,"(' Some notes')")
> qm(db)
V1
1 notes
> qrl(table,db)
V1
1 Some notes
>

No comments: