[R-SIG-Mac] query re ">" in Sweave output for Mac input
Duncan Murdoch
murdoch at stats.uwo.ca
Thu Jun 14 13:02:16 CEST 2007
On 13/06/2007 9:11 PM, Simon Urbanek wrote:
> On Jun 13, 2007, at 7:04 PM, William Revelle wrote:
>
>> Dear R Mac users,
>>
>> When writing examples for students, I typically use Sweave to
>> integrate the R code with the output. R code from Sweave
>> conventionally is preceded by the prompt character (typically ">").
>> Although this can be suppressed in Sweave, it seems as if the
>> conventional style is to include the prompt on every example line.
>> This leads to a syntax error on every line copied from a Sweave
>> example directly into R.
>>
>> Now my question:
>>
>> Is there some option in the Mac R-Gui that I have missed that allows
>> me to directly paste Sweave output of commands (i.e., including the
>> prompt) into R without first editing them out in the editor? I think
>> that this is possible in Windows (but have only been told that by my
>> students).
>>
>> If it is not possible, then what do people think about example code
>> not including the prompt?
>
>
> No, but it is on the wishlist
> http://wiki.r-project.org/rwiki/doku.php?id=misc:wishlist-mac
>
> Unfortunately I don't think I'll have time to look into this soon,
> but patches of R.app implementing this are highly welcome.
And for anyone interested in doing this, I'd suggest starting with the
code for "Paste commands only" that Tony Plate contributed to the
Windows Rgui, which is mostly in the CleanTranscript function in
https://svn.r-project.org/R/trunk/src/gnuwin32/console.c
It would probably make some sense to move this function into src/main,
since it's not really Windows-specific.
Duncan Murdoch
More information about the R-SIG-Mac
mailing list