Skip to content
Back to formatted view

Raw Message

Message-ID: <BANLkTimmfjbVi8J9CNw5YMr7yXqSH-pxGw@mail.gmail.com>
Date: 2011-04-13T21:27:28Z
From: Seth Falcon
Subject: Decimals in R/SQL
In-Reply-To: <2EFC465A5231C8448A638DD72E6D58000BA577AA@dc-mail2.kff.org>

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/