Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

File path issues in R using Windows ("Hex digits in character string" error)

I run R on Windows, and have a csv file on the Desktop. I load it as follows,

x<-read.csv("C:\Users\surfcat\Desktop\2006_dissimilarity.csv",header=TRUE) 

but the R gives the following error message

Error: '\U' used without hex digits in character string starting "C:\U"

So what's the correct way to load this file. I am using Vista

like image 544
user297850 Avatar asked Dec 08 '11 02:12

user297850


1 Answers

replace all the \ with \\.

it's trying to escape the next character in this case the U so to insert a \ you need to insert an escaped \ which is \\

like image 51
smitec Avatar answered Sep 20 '22 06:09

smitec