Search notes:

R: Quickly paste data into an R source file and read it with function textConnection

textConnection() can be used to read data that is stored in an R source file rather than an external file or URL.
textConnection() returns a connection object.
txtCon <- textConnection("1 1 2 3 5 8 13 21")
scanned <- scan(txtCon)
# Read 8 items

print(scanned)
# [1]  1  1  2  3  5  8 13 21
Github repository about-r, path: /functions/textConnection.R

See also

Import data into R for processing
Index to (some) R functions

Index