楼主: wqf_cufe
12139 41

[有偿编程] 求助用R进行融资融券数据的网页抓取 [推广有奖]

31
wqf_cufe 发表于 2015-1-9 12:16:15
daishen 发表于 2015-1-9 12:08
dat$成交额 = str_extract(dat[,7],"\\d+")
我建shiny遇到的错误提示:
  1. The following potential problems were identified in the project files:

  2. ------
  3. main.R
  4. ------
  5. The following lines contain absolute paths:
  6. 41:   g1 <- "\\d{4}-\\d{2}-\\d{2}"
  7. 42:   g2 <- "\\d+"
  8. 43:   g3 <- "\\d+"

  9. Paths should be to files within the project directory.
  10. Do you want to proceed with deployment? [Y/n]:
复制代码

32
daishen 发表于 2015-1-9 13:15:31
用 [[:digit:]] 替代 \\d 试一试。
dat$成交额 = str_extract(dat[,7],"[[:digit:]]+")

33
wqf_cufe 发表于 2015-1-9 13:43:01
daishen 发表于 2015-1-9 13:15
用 [[:digit:]] 替代 \\d 试一试。
dat$成交额 = str_extract(dat[,7],"[[:digit:]]+")
那个日期和成交量好像也不能含有//,能否改一下?

34
wqf_cufe 发表于 2015-1-9 13:54:05
daishen 发表于 2015-1-9 13:15
用 [[:digit:]] 替代 \\d 试一试。
dat$成交额 = str_extract(dat[,7],"[[:digit:]]+")
这个好像也能抓取,但是会产生很多重复的观测值。麻烦您看看。谢谢!

35
daishen 发表于 2015-1-9 14:09:29
dat$成交额 = str_extract(dat[,7],"[[:digit:]]+")

36
daishen 发表于 2015-1-9 14:10:34
dat$日期 = str_extract(dat[,1],"[[:digit:]]{4}-[[:digit:]]{2}-[[:digit:]]{2}")
已有 1 人评分论坛币 学术水平 热心指数 信用等级 收起 理由
wqf_cufe + 5 + 5 + 5 + 5 精彩帖子

总评分: 论坛币 + 5  学术水平 + 5  热心指数 + 5  信用等级 + 5   查看全部评分

37
wqf_cufe 发表于 2015-1-11 06:50:25
daishen 发表于 2015-1-9 14:10
dat$日期 = str_extract(dat[,1],"[[:digit:]]{4}-[[:digit:]]{2}-[[:digit:]]{2}")
谢谢!!!

38
taizi630111465 在职认证  发表于 2015-1-12 13:23:52
Thank you

39
引擎子 发表于 2015-1-12 19:42:56
谢谢分享

40
wqf_cufe 发表于 2015-1-13 07:03:43
dataorz 发表于 2015-1-8 10:55
网页 2
u = "http://app.finance.ifeng.com/hq/stock_daily.php?code=sh600030"
url = htmlParse(u, enco ...
你好,我试了一下这个code,它可以在Rstudio中运行,但是无法在Shiny端上运行,因为shiny只支持js格式的读取,用这个会出现下面的错误:ERROR:Error in make.names(vnames, unique = TRUE) : invalid multibyte string 5。

您看能否帮助一下?谢谢!!!

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2025-12-30 17:21