2010/6/27 顾小波 <guxiaobo1...@gmail.com>: > Hi, > > I post this message to the general r-help list hoping anyone within a wider > range have suggestions: > > > > There are three ways to integration R and postgres, especially on 64bit > Microsoft windows Platform, > > > > 1. via RODBC package, which has 32 bit and 64 bit version for windows > > 2. via RPostgres interface, which only has 32bit version currently > > 3. via plr for Greenplum, which only supports a few kinds of functionality, > and supports only specific versions of R. > > > > Do you have any idea about the advantages and disadvantages of each, and the > differences among them >
There is also the RpgSQL package. In addition the sqldf package uses RpgSQL. sqldf by default uses SQLite but if the RpgSQL package is loaded then it defaults to PostgreSQL. Here BOD Is a built in R data.frame: > library(sqldf) Loading required package: DBI Loading required package: RSQLite Loading required package: RSQLite.extfuns Loading required package: gsubfn Loading required package: proto Loading required package: chron > library(RpgSQL) Loading required package: RJDBC > BOD Time demand 1 1 8.3 2 2 10.3 3 3 19.0 4 4 16.0 5 5 15.6 6 7 19.8 > sqldf('select regr_slope(demand, "Time") slope, + regr_intercept(demand, "Time") intercept, + corr(demand, "Time") corr from BOD') Loading required package: tcltk Loading Tcl/Tk interface ... done slope intercept corr 1 1.721429 8.521429 0.8030693 > coef(lm(demand ~ Time, BOD)); cor(BOD$Time, BOD$demand) (Intercept) Time 8.521429 1.721429 [1] 0.8030693 ______________________________________________ R-help@r-project.org 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.