我想使用向量替换上述链接的数值(219889),以获得不同的链接。
library(XML)
library(RCurl)
players = c(4578,272279,7133)
for (i in players) {
read = HYPERLINK(CONCATENATE("http://stats.espncricinfo.com/ci/engine/player/",players[i],".html?class=1;spanmin1=01+Jan+2011;spanval1=span;template=results;type=batting;view=innings"))
}
答案 0 :(得分:1)
将sprintf
与%s
或%d
一起使用
sprintf("http://stats.espncricinfo.com/ci/engine/player/%s.html?class=1;spanmin1=01+Jan+2011;spanval1=span;template=results;type=batting;view=innings",players)
或paste0
paste0("http://stats.espncricinfo.com/ci/engine/player/", players, ".html?class=1;spanmin1=01+Jan+2011;spanval1=span;template=results;type=batting;view=innings")