the name of a file to read data values from. If the
specified file is ""
, then input is taken from the keyboard
(or stdin
if input is redirected).
(In this case input can be terminated by a blank line or an EOF
signal, Ctrl-D
on Unix and Ctrl-Z
on Windows.) Otherwise, the file name is interpreted relative to the
current working directory (given by getwd()
),
unless it specifies an absolute path.
Tilde-expansion is performed where supported.
Alternatively, file
can be a connection
,
which will be opened if necessary, and if so closed at the end of
the function call. Whatever mode the connection is opened in,
any of LF, CRLF or CR will be accepted as the EOL marker for a line
and so will match sep = "\n"
.
file
can also be a complete URL.
To read a data file not in the current encoding (for example a
Latin-1 file in a UTF-8 locale or conversely) use a
file
connection setting the encoding
argument.