[R] Decimals in R/SQL

Seth Falcon seth at userprimary.net
Wed Apr 13 23:27:28 CEST 2011


On Wed, Apr 13, 2011 at 1:34 PM, Rachel Licata <RachelL at kff.org> wrote:

> Thanks again Jim - that is really helpful and I apologize that I am
> new to R.  How can I convert to numeric in SQL and when I am working
> on a table in a database?  The file is huge so that is why I am
> using SQL and the database to work through it.

I believe that RSQLite will do the right thing if you provide the
correct types in your schema.  So for a new database, you want to make
sure that the columns that you want to be numeric are created like:

    CREATE table sometable (my_data REAL);

You should be able to create a new table from an existing table using
SQL where the new table has the types you want.

+ seth


-- 
Seth Falcon | @sfalcon | http://userprimary.net/



More information about the R-help mailing list