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