[R] RdbiPgSQL and POSIXct

Miha STAUT mihastaut at hotmail.com
Wed Dec 10 08:08:57 CET 2003


Hi,

Does the Bioconductor library RdbiPgSQL support the POSIXlt and POSIXct (R 
time format)?. I tried to import an R data frame which had also some columns 
of class POSIXct into PostgreSQL 7.2.1 with the command dbWriteTable without 
success.

>str(jame)
`data.frame':	8123 obs. of  27 variables:
$ kat.st       : int  1 2 3 4 5 6 7 8 9 10 ...
$ ime          : Factor w/ 7867 levels "1133 VG","2202 VG",..: 7788 2605 
4387 4932 5246 5121 3584 3721 3552 4521 ...
$ sinonim      : Factor w/ 1385 levels "","7P2","7P4",..: 1 1 863 1 935 1286 
1 1 1 798 ...
$ tip1         : num  4.3 1.2 5.2 5.2 5.3 4.2 5.6 NA 5.5 5.3 ...
$ tip2         : num  NA NA NA NA NA NA NA NA NA NA ...
$ x            : int  5129740 5127853 5113656 5113664 5113120 5113630 
5088530 5089000 5087400 5086256 ...
$ y            : int  5408790 5411028 5443482 5443450 5446130 5446030 
5443880 5447000 5442150 5446013 ...
$ x.lj         : int  5129740 5127840 5113660 5113660 5113120 5113490 
5088520 5088000 5087400 5086240 ...
$ y.lj         : int  5408790 5411000 5443480 5443450 5446130 5446100 
5443880 5447000 5442150 5445980 ...
$ tk.25        : Factor w/ 159 levels "Ajdov¹èina","Ba..",..: 116 116 56 56 
56 56 149 149 149 149 ...
$ ttn          : Factor w/ 1051 levels "Ajdov¹èina 1",..: 890 65 849 849 851 
851 984 985 991 993 ...
$ lega.po      : Factor w/ 11 levels "","GPS","teodol..",..: 7 10 11 11 10 4 
4 1 7 11 ...
$ ko           : Factor w/ 837 levels "","Adle¹ièi",..: 633 633 588 588 657 
657 772 743 130 743 ...
$ upravna.enota: Factor w/ 54 levels "Ajdov¹èina","Br..",..: 34 34 43 43 43 
43 52 52 26 52 ...
$ dolzina      : int  95 442 360 60 112 450 160 NA 23 130 ...
$ globina      : int  10 208 37 8 28 58 131 NA 23 42 ...
$ datum.obis   :`POSIXct', format: chr  "1925-07-11" "1958-08-01" 
"1925-07-26" "1925-07-26" ...
$ datum.zap    :`POSIXct', format: chr  NA NA NA NA ...
$ org          : Factor w/ 213 levels "","Anthron","Ar..",..: 76 179 76 76 
76 76 76 76 76 76 ...
$ udelezenci   : Factor w/ 3826 levels "","Abrahamsberg..",..: 2092 2722 
1184 1185 1427 1183 1426 2585 1909 10 ...
$ zapisnikar   : Factor w/ 589 levels "","Abrahamsberg..",..: 1 1 1 1 1 1 1 
345 345 345 ...
$ opombe       : Factor w/ 749 levels "","10","10t",..: 565 565 308 308 1 1 
318 31 28 308 ...
$ kat.st.VG    : int  NA NA NA NA NA NA NA NA NA NA ...
$ datum.vnosa  :`POSIXct', format: chr  "1990-09-18" "1990-09-19" 
"1993-03-01" "1990-09-18" ...
$ xpop         : num  129740 127853 113656 113664 113120 ...
$ ypop         : num  408790 411028 443482 443450 446130 ...
$ nv           : int  1525 650 780 780 451 439 497 470 483 634 ...

>dbWriteTable(conn,jame,"j")

The same command produced a good result with the date columns transformed to 
factor.

THE ERROR MESSAGE
NOTICE:  current transaction is aborted, queries ignored until end of 
transaction block # the same error message repeated many times (I guess 
length(jame$x))

Thanks in advance, Miha Staut




More information about the R-help mailing list