Other types of files

The readr package has other functions beside read_csv() to read files into R, such as:

  • read_csv2() for semicolon-separated (;) files.

    • Common in countries that use , as the decimal marker.
  • read_tsv() for tab-delimited files.

  • read_delim() reads in files with any delimiter, it tries to guess the delimiter if not specified.

  • read_fwf() for fixed-width files.

    • You can specify fields by their widths with fwf_widths() or by their positions with fwf_positions().
  • read_table(). Columns are separated by white space.

  • read_log() for Apache-style log files.