R Tutorial - New Way to Connect to SteemSQL via RStudio - R 教程之通过 RStudio 来快速连接SteemSQLsteemCreated with Sketch.

in #cn7 years ago (edited)


Image Credit: Pixabay.com

Last month, in my R tutorial, I showed you how to connect to SteemSQL in R script. The latest R Studio has added a connection tab, which is a Database wizard that you can easily follow to connect to @arcange 's STEEMSQL

And, if we click the 'New Connection', choose ODBC

Most likely, you will have to install the package 'ODBC' on the fly.

You can either choose 'SQL Server' or 'SQL Server Native Client 11.0' from the 'Data Sources'

And enter the Parameters textbox as the following values:

Server=sql.steemsql.com;Database=DBSteem;Uid=steemit;Pwd=steemit

You can test the connection before you proceed further.

If you connect from 'R Console', the DBSteem object from SteemSQL will immediately become available.


上个月,我在我的R教程里介绍了如何通过R脚本来连接STEEMSQL。最新的R STUDIO添加了一个 Connection (SteemSQL) ,可以用于快速连接各种数据库,比如 @arcange 's STEEMSQL

选择 'New Connection', - ODBC

第一次需要安装 ODBC这个包

我们可以选择数据源 'SQL Server' 或者 'SQL Server Native Client 11.0'

然后在参数列表里添加:

Server=sql.steemsql.com;Database=DBSteem;Uid=steemit;Pwd=steemit

最好测试一下链接。

如果我们选择 'R Console', 这样数据库对象就能立马在窗口中浏览。


@justyy 是有名的晒媳妇博主,也是西半球最装X装土豪 (https://justyy.com) 的博主。@justyy 定居英国,一妻两娃,在STEEMIT上开办了历史上中文第一家银行,史称 YY央行,每日赔钱吆喝。
@justyy@tumutanzi 大哥 的介绍下加入 STEEMIT,写些帖子挣些小钱养家糊口。
@justyy 凡事喜欢折腾,现在在一家英国软件公司里当码农,好听一点叫作算法攻城狮。 @justyy 喜欢结交天下好友,一起YY。


@justyy 也是CN 区的点赞机器人,对优质内容点赞,只要代理给 @justyy 每天收利息(年化率10%)并能获得一次至少2倍(VP 200%+)的点赞,大鱼 @htliao 都加入了这个计划(530 SP)表示支持。

  1. cn区最低保障系统 上线了!
  2. cn区低保计划(鼓励新人)真的适合你么?
  3. 今天(2017-11-10) 银行股东名单
  4. CN 中文区每日【财富总值】【活跃统计数据】
  5. CN 中文区每日【点赞收益年化率】【YY银行利息统计】

AD 一波,听说最近 STEEM没有SBD值钱,那赶紧加入 CN区低保银行,成为股东,好处多多,每天收获点赞并且能获得10%的利息(发放SBD),今日股东列表

Sort:  

great post .... thanks for sharing

这个不错,看起来简单又容易操作,ReSteem

多谢大伟 哥肯定和支持。

这个很有意思,那比如怎么查询一个人发的帖子全文呢?不知道数据库有没有这么强大

这个很简单:
select title,body from Comments where author='justyy'

大概解决了,但是中文都是???,怎么解决呢?

sql <- "select title from Comments where author='justyy'"
res <- dbSendQuery(con, sql)

fch.res <- dbFetch(res, n = 10)
print(fch.res)
title
1 ???/??????????
2 2017 ???(?)?(?)? - Happy Bonfire Night 2017!
3 ???????:???????(2) ?????????
4 2???? 77????? Number 77 Thai Kitchen
5 2017-08-26 ??cn?????????????+???7???????
6 2017-08-25 ??cn??? '????????'
7 2016 Bonfire Night ?????? (???)
8 ?????2016????(????)
9 ????????? - ??200STEEM?1?SP??!
10 ??????????2????

这个我不太记得了, 我只记得之前 @oflyhigh 哥有篇文章里就专门提到这个问题,要不你问问他吧。
好像和编码有关, utf-8 之类的。

我搜到他那篇文章了,不算是一回事。
总的还是有点不爽,中文的查询。

ReSteemed! 留來慢慢學

Thanks!

Calling @originalworks :)
img credz: pixabay.com
Nice, you got a 15.0% @pula78 upgoat, thanks to @justyy
It consists of $2.01 vote and $0.67 curation
Want a boost? Minnowbooster's got your back!

以后这种文章可以发utopian.io。现在他们接受tutorial。

发现rstudio有免费mac版,高高兴兴下载安装,结果不能运行,不知道怎么回事。

嗯,我也有此意,这样一来,英文发UTOIPIAN,中文还可以再发一篇,哈哈。

Coin Marketplace

STEEM 0.17
TRX 0.15
JST 0.028
BTC 56677.48
ETH 2329.02
USDT 1.00
SBD 2.36