11.1 On vectors

  • Read a file as a vector with the scan function

By default, scans “double” (numeric) elements: it fails if the input contains characters.
If non-numeric, you need to specify the type of data contained in the file:

Regarding paths of files:
If the file is not in the current directory, you can provide a full or relative path. For example, if located in the home directory, read it as:

  • Write the content of a vector in a file:

Regarding paths of files:
When you write a file, you can also specify a full or relative path: