Monday, May 24, 2010

How's my database?

Right now I have added a utility to create an Sqlite table in the exact image of an R Stat data frame, matching columns names. So variable names are consistent across.
This code creates an R based data frame from the 12 table of the database db;

> y <- qrl(tb[12],db,mode="h")
> y
idx Year Value
1 1 1971.44 37.9
2 2 1971.52 38.1
3 3 1971.61 38.3

I have a small utility.r file which contains an insertTable function that creates an SQL table t match an R based data frame.
insertTable(x)

So my general strategy is to reading data to R, make sure the headers look of, edit as needed, then insert the dataf rame into a table.
My 100 Essentials have been update on the right of the web page.

No comments: