as_url2file: transfrom a url to link to a file

Description Usage Arguments Value example

View source: R/utility.R

Description

This is the core function, and why I want to write this package. wget just download www.foo.com/bar/index.html to ./www.foo.com/bar , and then overwrite that file to a folder while downloading other HTML files in www.foo.com/bar/ . I just want to ask whether you want to cry.

Usage

1

Arguments

url

string. mustn't contain tailing '/', because in this situation there is no need to distinguish www.foo.com/bar/index.html from www.foo.com/bar (www.foo.com/bar/ must be www.foo.com/bar/index.html)

Value

string. paste0(url, '/') if it's accessible (there exist a index.html file)

example

as_url2file('www.cookbook-r.com/Graphs'); as_url2file('www.cookbook-r.com/Graphs2'); # not exist, for testing


dongzhuoer/rget documentation built on July 29, 2020, 1:45 p.m.