May 2019
Beginner to intermediate
266 pages
5h 57m
English
The read_fwf method is used to read data from fixed width files, where every field is in the same place in every line. The default usage will be to read the data in text format in the R workspace. The code for this is shown as follows:
read_fwf("data.txt")
Here, readr will try to guess the column widths. However, to avoid errors, you could also specify column widths explicitly as follows:
read_fwf(data.txt, fwf_widths(c(10, 20, 18), c("ID", "Revenue", "Region")))
Read now
Unlock full access