search for: esstr

Displaying 2 results from an estimated 2 matches for "esstr".

Did you mean: estr
2006 Jul 16
1
Generating valid R code using R
...ers): abcdef<tab>ghijk\nlmno second row\t\a\\ fourth and so on... <EOF> Now, find escapeString() such that the following piece of code generates a second file called 'file2.txt' which is identical to 'file1.txt': inStr <- readChar("file1.txt", nchars=999) esStr <- escapeString(inStr) rCode <- sprintf('cat(file="file2.txt", "%s")', esStr) cat(file="foo.R", rCode) source("foo.R") For instance, quotation marks has to be escaped in order for 'rCode' to be valid, same with newlines etc. What's...
2006 Jul 16
1
Generating valid R code using R
...ers): abcdef<tab>ghijk\nlmno second row\t\a\\ fourth and so on... <EOF> Now, find escapeString() such that the following piece of code generates a second file called 'file2.txt' which is identical to 'file1.txt': inStr <- readChar("file1.txt", nchars=999) esStr <- escapeString(inStr) rCode <- sprintf('cat(file="file2.txt", "%s")', esStr) cat(file="foo.R", rCode) source("foo.R") For instance, quotation marks has to be escaped in order for 'rCode' to be valid, same with newlines etc. What's...