###R读取Greenplum database数据
####R读取gpdb的相关包安装
1
install.packages("RPostgreSQL")
####R读取股票代码
1
2
3
4
5
6
7
8
9
10
library(RPostgreSQL)
con <- dbConnect(PostgreSQL(), host = "10.2.28.234", port = 5432, user= "fitl", password="xxxx", dbname="fitl")
rs <- dbGetQuery(con,"select windcode, code, market, cnname, enname, type from hffd.tdb_codes")
head(rs, n=10L)
dbDisconnect(con)
####效果如下
通过RStuido测试