Two possible solutions:

1. Redefine the LaTeX environment so it allows wrapping (see listings
for example);
2. Manually break your long string into shorter pieces and paste()
them together, e.g. paste('long', 'long', 'string')

Regards,
Yihui
--
Yihui Xie <xieyi...@gmail.com>
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Mon, Aug 20, 2012 at 5:03 PM, Simon Kiss <sjk...@gmail.com> wrote:
> Hi there: I'm preparing a report in RStudio 0.96.330 on a Mac OS. I'm running 
> R 2.15.0
>
> I understand from Ross Ihaka's document 
> (http://www.stat.auckland.ac.nz/~stat782/downloads/Sweave-customisation.pdf) 
> that you can modify the line length of Sweave output by a call to 
> options(wdith=x).
>
> This works great for me for numeric output, but not for character vectors 
> that I have to print. The following is some sample code that illustrates my 
> problem.
>
> Is there a different way to format character vectors that are stored in R?
> Yours, Simon Kiss
>
> \documentclass{article}
>
> \begin{document}
> \SweaveOpts{concordance=TRUE}
>
> <<echo=TRUE, results=verbatim>>=
> seq(1,100,1)
> @
>
> <<echo=TRUE, results=verbatim>>=
> options(width=30)
> @
> <<echo=TRUE, results=verbatim>>=
> seq(1,100,1)
> @
>
> <<echo=TRUE, results=verbatim>>=
> test<-c('The government should do more to advance societys goals, even if 
> that means limiting the freedom and choices of individuals.')
> @
>
> \end{document}
> *********************************
> Simon J. Kiss, PhD
> Assistant Professor, Wilfrid Laurier University
> 73 George Street
> Brantford, Ontario, Canada
> N3T 2C9
> Cell: +1 905 746 7606
>
> Please avoid sending me Word, PowerPoint or Excel attachments. Sending these 
> documents puts pressure on them to use Microsoft software and helps to deny 
> them any other choice. In effect, you become a buttress of the Microsoft
> monopoly. This pressure is a major obstacle to the broader adoption of free 
> software.
>
> To convert to plain text choose Text Only or Text Document as the Save As 
> Type.  Your computer may also have a program to convert to PDF format. Select 
> File, then Print. Scroll through available printers and select the PDF 
> converter. Click on the Print button and enter a name for the PDF file when 
> requested.
>
> ______________________________________________
> 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.

______________________________________________
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.

Reply via email to