试试这个
tmp <- as.numeric(gsub(x = seq.Date(from = as.Date("16-08-28"),to = as.Date("16-10-04"),by = "week"),pattern = "-",replacement = ""))
#[1] 160828 160904 160911 160918 160925 161002
它将处理数字部分并使用paste
函数来创建完整的下载链接。
paste0("http://WEBSITENAMEHERE_",tmp,".full.rdb.gz")
#[1] "http://WEBSITENAMEHERE_160828.full.rdb.gz"
#[2] "http://WEBSITENAMEHERE_160904.full.rdb.gz"
#[3] "http://WEBSITENAMEHERE_160911.full.rdb.gz"
#[4] "http://WEBSITENAMEHERE_160918.full.rdb.gz"
#[5] "http://WEBSITENAMEHERE_160925.full.rdb.gz"
#[6] "http://WEBSITENAMEHERE_161002.full.rdb.gz"