read: Read file/webpage

Description Usage Arguments Value See Also Examples

View source: R/read.R

Description

Returns text/source from file or URL

Usage

1
read(.x)

Arguments

.x

Path to file or URL

Value

A string of read-in text

See Also

Other read: readl

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## create a temp file containing multiple lines of text
tmp <- tempfile()
cat("TITLE", "", "By", "", "Some more text here", "",
  "last line", sep = "\n", file = tmp)

## read contents from tmp
read(tmp)

## cleanup
unlink(tmp)

## read contents from a website
read("http://httpbin.org/get")

readthat documentation built on Oct. 30, 2019, 10:11 a.m.