read.https: Use 'read.table' with a secure http url (https)

View source: R/https.R

read.httpsR Documentation

Use read.table with a secure http url (https)

Description

Uses functions in the httr package to load a file at a secure url (regular urls work too)

Usage

read.https(
  URL,
  local.file = NULL,
  delete = TRUE,
  verbose = TRUE,
  FUN = read.table,
  ...
)

get_https(URL, ...)

Arguments

URL

character; the location of the file

local.file

character; if NULL a temporary file is used

delete

logical; should local.file be delete upon exit?

verbose

logical; should messages be shown?

FUN

the function to use for reading URL; default is read.table

...

additional parameters sent to URL or content

Details

The main function to be used is read.https.

Author(s)

A.J. Barbour

Examples

## Not run: 
x <- "https://raw.githubusercontent.com/abarbour/pborepo/master/data/gen/lsm_coords"
get_https(x) # returns raw content
read.https(x, header=TRUE) # an actual data.frame instead
# (if 'x' is, say, a csv file, change FUN: read.https(x, FUN=read.csv)

## End(Not run)

abarbour/pborepo documentation built on April 27, 2022, 8:47 a.m.