GREA icon indicating copy to clipboard operation
GREA copied to clipboard

Na.string format wrong

Open nhward opened this issue 9 months ago • 0 comments

Importing a CSV file with missing-value placeholders "-99, --"

An examination of the generated command shows
read.table(file = "2022_Ass2Data.csv", sep = ",", dec = ".", header = TRUE, na.strings = "-99,--")
whereas what is required / expected is
read.table(file = "2022_Ass2Data.csv", sep = ",", dec = ".", header = TRUE, na.strings = c("-99","--"))

Clearly, this only works for a single missing value placeholder.

na.strings needs to be string-split into a vector based on ","

nhward avatar May 07 '24 23:05 nhward