Decision
Try the following: x <- read.csv("C:/Users/surfcat/Desktop/2006_dissimilarity.csv", header=TRUE)
Explanation
R cannot correctly understand the normal Windows paths because "\" has a special meaning - it is used as an escape character to give the following characters special values ( \n for a new line, \t for a tab, \r for carriage return ,. .. see here ).
Since R does not know the \U sequence, she complains. Just replace "\" with "/" or use the extra "\" to avoid the "\" from its special meaning, and everything works smoothly.
Alternative
In windows, I find it best to improve the workflow with specific Windows paths in R, to use, for example. AutoHotkey, which allows you to configure hotkeys:
- define a hotkey, for example. Cntr - Shift - V
- assigns it a procedure that replaces the backslash in your clipboard slaches ...
- when you want to copy the path insert into R, you can use Cntr - Shift - V instead of Cntr - V
- Et voila
AutoHotkey code snippet (link to the main page)
^+v:: StringReplace, clipboard, clipboard, \, /, All SendInput, %clipboard%
petermeissner Jan 15 '13 at 10:02 2013-01-15 10:02
source share