Add a character other than "X" to make syntactically valid column names

When reading csv, R automatically appends the letter X to syntactically invalid column names. For instance:

> read.csv(text = "a,1,b")
[1] a  X1 b

How can I add another letter inside the read.csv function when reading in a file, for example, instead of "X" add "foo" to output the output ?:

[1] a  foo1 b
+4
source share

Source: https://habr.com/ru/post/1690059/


All Articles