[Blindmath] How to get R output in a html file

Jonathan Godfrey a.j.godfrey at massey.ac.nz
Mon Jun 3 23:03:06 UTC 2013


Hi,

Sorry it's taken a few days to answer your question. I've been away for the
long weekend here am only now clearing email.

I'm having to guess a bit as you haven't told me which version of R you are
running (doesn't really matter much) or the operating system you use, and
the browser you view the text file in.

Viewing the text file R creates with sink() does have its problems. First, R
can get itself into a tangle because of line ending character differences
among the various operating systems. I have also observed that under
windows, some output can actually cause the sink file to be poorly rendered
in a browser. Try switching browser as a first step.

The sink() isn't anything but plain text. You could see how it is rendered
in a simple text editor.

My BrailleR add on package creates a text file as well, but does not use
sink(). You might find this approach more useful.

My next questions are based on the needs you have. If you actually want html
output, you could use the r2html add on package. This would start sending
your output to the specified file and can even add in the graphics you
create although that requires some extra work.

If you are a LaTeX user, then you could use the Sweave functionality built
into R or the knitR package. These options are useful when writing up a
report or assignment, especially if you write the report before the complete
data set is available, or might need to update the analysis for some other
reason. This is known as reproducible research. I use this approach a lot as
I can create a text file with the R commands I want as well as a file that
is then the *.tex file that gets turned into a pdf for the sighted world, or
html/xml for web publishing.

See more comments at:
http://r-resources.massey.ac.nz/statsoftware/

or write to me off list with more specific questions and details.

Jonathan



-----Original Message-----
From: Blindmath [mailto:blindmath-bounces at nfbnet.org] On Behalf Of Alejandro
Troncoso Novoa
Sent: Friday, 31 May 2013 6:23 p.m.
To: Blindmath at nfbnet.org
Subject: [Blindmath] How to get R output in a html file

Hello, i'm trying to get R outputs in a html file, i'm using sink() comand
but when i refresh the browser, the new output is printed in the same line .
I need to get the output in the lines below; is there anyone who can tell me
how i can do that?
(excuse me for my english, it's not my native language) Thanks.

Alejandro Troncoso Novoa.
_______________________________________________
Blindmath mailing list
Blindmath at host.nfbnet.org
http://host.nfbnet.org/mailman/listinfo/blindmath_nfbnet.org
To unsubscribe, change your list options or get your account info for
Blindmath:
http://host.nfbnet.org/mailman/options/blindmath_nfbnet.org/a.j.godfrey%40ma
ssey.ac.nz





More information about the BlindMath mailing list