Re: [R] RSQLite NA on input

From: Seth Falcon <sfalcon_at_fhcrc.org>
Date: Tue 09 Jan 2007 - 15:19:42 GMT

Hi Richard,

It would help if you provided a bit more on how you are going about the import (along with your version of R and RSQLite).

R Gott <richard.gott@dur.ac.uk> writes:
> I haev some .csv data files with missing values - eg below
>
> 1,'F','C04','X100',20.93,'C','B',7,8,7.5,2421,2230,2230,2,1,85,43,85,46,48,60
>
> If I have a missing value - so file looks like ,85,46,,48, etc
> then RSQLite reads it as zero. ,85,46,0,48, etc
> I need it read it as NA.
>
> Tried various combinations with no success, adn found nothing on help
> site. Must be somehting very simple but . . . .
>
> Help much appreciated.

The most flexible approach would be to use read.table to read in your csv file. Then use dbWriteTable to put the resulting data.frame object into the DB.

+ seth



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Thu Jan 11 01:33:17 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 10 Jan 2007 - 15:30:30 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.