Sweave and long strings

Laurent Rhelp laurentRhelp at free.fr
Sun Mar 5 13:15:44 CET 2006


Dear R-List,

    I use Sweave (which is wonderful) and I have a problem with the 
strings when they are too long according to the width of the page. For 
example when I do in my .Rnw document :

<<UsingRODBC,echo=TRUE>>=

channel <- odbcConnect(dsn="database",uid="root",pwd="password")
df1 <- sqlFetch(channel,"table1",rownames=TRUE)
df2 <- sqlFetch(channel,"table2",rownames=TRUE)

cmd <- "SELECT t1.isoisotope,
               t1.periode,t1.nbZ,
               t2.filnomchaineradio,
               t2.filcodepere,
               t2.filcodefils,
               t2.filproba,
               t2.filtransition from table1 t1,
                                            table2 t2
         WHERE t1.isoisotope = t2.filcodepere"

dfQuery <-  sqlQuery(channel, cmd )
odbcCloseAll()

@

etc...

in the pdf document the command
cmd <- "SELECT t1.isoisotope,  t1.periode,t1.nbZ,  
t2.filnomchaineradio,  t2.filcodepere,  t2.filcodefils,
is written truncated only on one line not as it is written in the chunk 
above.

I read in the R-archives we have to use the options command but even 
using options(width=30) in the chunk it doesn't work.

May you help me ?

Thanks





More information about the R-help mailing list