I have an S-Plus library that I would like to port to R. The library sends a mix of static and dynamic output to an html file. For example cat(" ... Big block of HTML formatting code ... ") cat(dat()) cat(" More static text ") With S-Plus I can just cut and paste HTML code from other files into my S-Plus script file. This makes maintenance of the script fairly easy. The R parser chokes on this and requires strings to have a backslash for line continuation: f = function(){ sometext = " abc \ def" } Mark Bravington discussed the same issue (with comments about the documentation) here: http://tolstoy.newcastle.edu.au/R/help/02b/5199.html I would like to echo Mark's request that compatability with S-Plus be considered. Thanks Kevin Wright
One workaround is the idea in http://maths.newcastle.edu.au/~rking/R/help/03a/6855.html which, applied to this problem would be used by entering the snippets as inline data files and reading them into R variables which can then be cat'ed. You do have to preface each line of the inline data with a marker but that is trivial in sufficiently powerful text editors. --- Date: Wed, 28 Jul 2004 15:09:04 -0700 (PDT) From: Kevin Wright <kwright@eskimo.com> To: <r-devel@stat.math.ethz.ch> Subject: [Rd] Parsing multi-line strings. Bug? Feature? I have an S-Plus library that I would like to port to R. The library sends a mix of static and dynamic output to an html file. For example cat(" ... Big block of HTML formatting code ... ") cat(dat()) cat(" More static text ") With S-Plus I can just cut and paste HTML code from other files into my S-Plus script file. This makes maintenance of the script fairly easy. The R parser chokes on this and requires strings to have a backslash for line continuation: f = function(){ sometext = " abc \ def" } Mark Bravington discussed the same issue (with comments about the documentation) here: http://tolstoy.newcastle.edu.au/R/help/02b/5199.html I would like to echo Mark's request that compatability with S-Plus be considered. Thanks Kevin Wright
Perhaps the two of you would like to submit a patch for consideration? I think you can take it that it was considered in Dec 2002 and no one wanted to do the work to check the feasibility. The form in Open Source projects is that those who want a feature implement it and offer it to the maintainers. On Wed, 28 Jul 2004, Kevin Wright wrote:> I have an S-Plus library that I would like to port to R. The library > sends a mix of static and dynamic output to an html file. For example > > cat(" > ... > Big block of HTML formatting code > ... > ") > cat(dat()) > cat(" > More static text > ") > > With S-Plus I can just cut and paste HTML code from other files into my > S-Plus script file. This makes maintenance of the script fairly easy. > > The R parser chokes on this and requires strings to have a backslash for > line continuation: > > f = function(){ > sometext = " abc \ > def" > } > > Mark Bravington discussed the same issue (with comments about > the documentation) here: > http://tolstoy.newcastle.edu.au/R/help/02b/5199.html > > I would like to echo Mark's request that compatability with S-Plus > be considered. > > Thanks > > Kevin Wright > > ______________________________________________ > R-devel@stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-devel > >-- Brian D. Ripley, ripley@stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595