On 11 Feb 2009, at 13:41, Gustaf Rydevik wrote:
On Wed, Feb 11, 2009 at 2:15 PM, baptiste auguie
<ba...@exeter.ac.uk> wrote:
A somewhat twisted approach that has not been mentioned is to
consider
everything a comment unless it is enclosed in special tags, as done
in the
brew package,
for example,
brew(textConnection(
"You won't see this R output, but it will run. <% foo <- 'bar' %>
Now foo is <%=foo%> and today is <%=format(Sys.time(),'%B %d, %Y')
%>."
) )
gives,
You won't see this R output, but it will run.
Now foo is bar and today is February 11, 2009.
I'd love to see an editor with a "brew" mode that acts as a
notebook: you
type in your text in whatever language without worrying about the
syntax (R
syntax, i mean!), and when you want to do a calculation you just
enclose it
in such tags that behave like an inverted block comment.
Just a thought,
baptiste
Isn't this almost exactly what ?Sweave does? (and odfWeave).
Granted, you have to deal with latex code to get nice output, but
latex is a GoodThing (tm).
LaTeX is indeed very good for some situations, but considering valid
latex code to be a convenient format for mere code comments would be
quite a stretch if you ask me. I like the light and flexible approach
of brew(), it can in fact output latex code if if you feel like it. Or
html. Or markdown. Or ...
baptiste
/Gustaf
--
Gustaf Rydevik, M.Sci.
tel: +46(0)703 051 451
address:Essingetorget 40,112 66 Stockholm, SE
skype:gustaf_rydevik
_____________________________
Baptiste AuguiƩ
School of Physics
University of Exeter
Stocker Road,
Exeter, Devon,
EX4 4QL, UK
Phone: +44 1392 264187
http://newton.ex.ac.uk/research/emag
______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.