downloader: Download Files over HTTP and HTTPS

> library(downloader)

Attaching package: 'downloader'
The following object is masked from 'package:devtools':

    source_url

バージョン: 0.4


関数名 概略
download Download a file, using http, https, or ftp
downloader downloader: a package for making it easier to download files over https
sha_url Download a file from a URL and find a SHA-1 hash of it
source_url Download an R file from a URL and source it

download

http, https, ftp からファイルをダウンロード。utils::download.fileのラッパー関数

Arguments

  • url: ダウンロードするファイルのURL
  • ...: download.file()と同じ引数が有効
> download(url      = "https://github.com/wch/downloader/zipball/master",
+          destfile = "downloader.zip", 
+          mode     = "wb")

sha_url

> test_url <- paste0("https://gist.github.com/wch/dae7c106ee99fe1fdfe7",
+                    "/raw/db0c9bfe0de85d15c60b0b9bf22403c0f5e1fb15/test.r")
> sha_url(test_url)

source_url

ウェブ上のRファイルを読み込む

> test_url <- paste0("https://gist.github.com/wch/dae7c106ee99fe1fdfe7",
+                    "/raw/db0c9bfe0de85d15c60b0b9bf22403c0f5e1fb15/test.r")
> source_url(test_url, sha = "9b8ff5213e32a871d6cb95cce0bed35c53307f61")
> # source("test_url")