0

The World Health Organization dataset is available here: http://www.filedropper.com/who

When the data is read using fread (from the data.table package), or read_csv (from the readr package) some variables are wrapped within letter r, and are shown as character type. Like so:

"\r31.1\r".

I checked the dataset in notepad and indeed it looks weird as these values are wrapped within (' '). However they are numeric, and when the regular read.csv is used there is no such problem.

What's the reason behind this? How to fix?

DeveauP
  • 1,137
  • 9
  • 21
ilyas
  • 479
  • 6
  • 20

1 Answers1

1

the '\r' is e special character used as a new line delimiter for files on windows.

When using read_csv setting the argument escape_backslash=TRUE might do the trick.

Check this for further reading.

mathiasw24
  • 53
  • 1
  • 7