Description Usage Arguments Value See Also Examples
Returns lines of text/source from file or URL
1 | readl(.x, first = 1, last = -1)
|
.x |
Path to file or URL |
first |
The first (starting) line number in which reading should start (inclusive). Defaults to 1. |
last |
The last (ending) line number in which reading should end (inclusive). To ensure the reading of all possible lines, set this value to less than 1 (0 or -1). Defaults to -1. |
A vector of lines read from input
Other read: read
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ## 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 all lines of tmp
readl(tmp)
## read first three lines
readl(tmp, 1, 3)
## read lines 3-5
readl(tmp, 3, 5)
## cleanup
unlink(tmp)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.