html日期列表怎么写,在日期列表中使用readHTMLTable并使用数据创建新日期列

我正在尝试编写一个循环来执行readHTMLTable(),通过公式提供的连续日期列表。我已成功导入日期之间的所有数据。但是,该数据并不包含日期列,因此使用我提供循环的日期序列,我希望循环读取HTML表格,然后添加一个新列以及用于该迭代的日期。在日期列表中使用readHTMLTable并使用数据创建新日期列

这是我到目前为止有:

library(XML)

library(RCurl)

library(plyr)

# create the days

x

# create a url template for sprintf()

utmp

# convert to numeric matrix after splitting for year, month, day

m

# create the list to hold the results

tables

# get the tables

for(i in seq_len(nrow(m))) {

# create the url for the day and if it exists, read it - if not, NULL

tables[[i]]

readHTMLTable(u, stringsAsFactors = FALSE)

else NULL

}

data

所以基本上,我想我的最终数据帧以特色m一个名为像data$Date新列。

感谢您的帮助,如果您需要澄清,请告诉我!

2016-01-25

medavis6

+0

如果循环中没有'Sys.sleep',那么您违反了网站的[服务条款](http://www.sports-reference.com/termsofuse.shtml)。 –

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值