Skip to content
Prev 370138 / 398503 Next

Extraneous full stop in csv read

On 28/06/2017 7:30 PM, John wrote:
Yes, "in" is not a valid variable name, because of its syntactic use. 
You can stop this correction by setting check.names=FALSE in your call 
to read.csv.  This will make it a little tricky to deal with in some 
situations, e.g.

 > x <- data.frame(4)
 > names(x) <- "in"
 > x
   in
1  4
 > x$in
Error: unexpected 'in' in "x$in"

but you can work around this problem: x[, "in"] and x$`in` are both fine.

Duncan Murdoch