[R] backslash
Robert.King@mailbox.gu.edu.au
Robert.King at mailbox.gu.edu.au
Tue May 23 02:42:56 CEST 2000
On Mon, 22 May 2000, Uwe Ligges wrote:
> On 22 May 2000, Peter Dalgaard BSA wrote:
>
> > Helgi Tomasson <helgito at hi.is> writes:
> >
> > > Hi R-people
> > >
> > > I am trying to have R write latex-code.
> > > do not produce similar results. I would like to something like
> > >
> > > write("\begin{tabular} ,file=. . .)
> > > .
> > > .
> > > .
> > > write("\end{tabular},file=. . .)
> >
> > Hmmm. Not too clear what your problem is but if something is eating
> > your backslashes, chances are that you just need to double them, as in
> >
> > > cat("\\help\n")
> > \help
> >
> > In some rare cases you need to redouble them, but this is not one of
> > them, I think....
>
> Oh. It is one of these cases , I think:
> \b means: Backspace!
>
> To write something with "\" in it, it is much safer to double the "\"
> every time.
This means that for the \\ at the end of lines of tables you need to
double each backslash. e.g. for some tables I produced I had R code like
this ...
tabfile _ "../tex/zzq.table"
write("\\begin{table}\\label{table:zzq}\\caption[Summary of results --- simulation zzq]",file=tabfile,append=T)
write("\\begin{tabular}{|l|c|c|c|c|}",file=tabfile,append=T)
write("\\multicolumn{5}{c}{$\\hat\\la$ (true value = \\laval)}\\\\",file=tabfile ,append=T)
write("\\hline",file=tabfile,append=T)
write("method & mean & median & std. dev. & IQR \\\\",file=tabfile,append=T)
write("\\hline",file=tabfile,append=T)
write(paste('starship (K-S) &',signif(mean(ks.zzq$l1),4),' & ',
signif(median(ks.zzq$l1),4),' & ', signif(sqrt(var(ks.zzq$l1)),4),' & ',
signif((quantile(ks.zzq$l1,.75)[[1]]-quantile(ks.zzq$l1,.25)[[1]]),4),
' \\\\ '),file=tabfile,append=T)
write("\\hline",file=tabfile,append=T)
----
Robert King, Australian Environmental Studies, Griffith University, Australia
3875 6677 Robert.King at mailbox.gu.edu.au http://www.ens.gu.edu.au/robertk/
"I would rather spend 10 hours reading someone else's source code than
10 minutes listening to Musak waiting for technical support which isn't."
(By Dr. Greg Wettstein, Roger Maris Cancer Center)
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
More information about the R-help
mailing list