[R] apparent problems with the textConnection command
rv15i at yahoo.se
Wed May 19 10:35:12 CEST 2010
In my experiments in reading in text data, I have obtained some peculiar results. I would appreciate any help in understanding these results. Consider the following code :
## Reading in text data from a text file
### the first line of file f1.txt contains the text : c:\Rtools\bin;c:\Rtools\perl\bin;c:\Rtools\MinGW\bin;
####### the above code gives exactly the results that I want
# next, attempt to read the same text in via textConnection
The results that I obtained (with an echo of the commands) were :
Error: '\R' is an unrecognized escape in character string starting "c:\R"
What I would like to know :
1. The textConnection command is, from what I understand, usually used to test typical data in a text file. However, in my example, initial testing with this command fails while the longer step of reading from a text file succeeds. Is there any reason for this? Is there any workaround for the problem with the textConnection command ?
2. There appear to be similiar problem with the read.table command. Using the allowEscapes =TRUE did not seem to help. Is there some other option here? Like, for example, temporarily setting another character like "<" as the escape character?
I would like to explain here that these questions are not directly related to any real world problem solving. They are just my attempts to understand the R language better.
More information about the R-help