Hello Greg,
Thank you for the coding.

A few questions and remarks:

1) I have a feature request that I believe Faiz is interested in:
He would like to have the formatting of tables/data.frames in the output to
be prettier then the one extracted from the console output.  I wonder if
that is (reasonably) possible.

2) I don't know if you had seen, but I already wrote a code to do such a
thing here:
http://www.r-statistics.com/2010/05/helping-the-blind-use-r-by-exporting-r-console-to-word/
And would like to include your instructions in the post as well.
Is there any other features or advantage of the new code, that should be
included when writing about it ?

3) In a more general note -
I think the challenges of the blind using R are interesting to look into.  a
good example would be to ask if there are ways of making R output more
easily readable for text to speech softwares.
For example, imagine how a summary.lm output looks like.  Now imagine how a
text-to-speech would read it.  Might there be a way to take such output and
rearranging it in such a way so to allow the blind to easily listen to the
results ?


Best regards,
Tal





----------------Contact
Details:-------------------------------------------------------
Contact me: tal.gal...@gmail.com |  972-52-7275845
Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) |
www.r-statistics.com (English)
----------------------------------------------------------------------------------------------




On Tue, May 25, 2010 at 10:23 PM, Greg Snow <greg.s...@imail.org> wrote:

> OK, I have uploaded a few new functions to the TeachingDemos package on
> R-forge (it will be a while before the CRAN version is updated, but you can
> install directly from R-forge once the changes show up there).
>
> The main functions to use (after loading TeachingDemos) are wdtxtStart and
> wdtxtStop (these depend on the R2wd package, so make sure that it is
> installed as well).
>
> You just need to make sure that either you do not have any word documents
> open, or your currently open word document is blank or the one that you want
> your R transcript inserted into, then just issue the wdtxtStart() command.
> From that point on, all your commands and results from R will be inserted
> into the word document as you go, so you can switch to word any time and
> review the commands and results.  Just be sure to scroll down to the bottom
> of the document before going back to R as the new commands and output will
> be inserted wherever the cursor was when you went back to R (possibly in the
> middle of something else if you are not careful).
>
> I hope this helps and let me know if you have any problems with it, or if
> there are additional bells and whistles that would improve the functions (I
> do have plans to eventually add some color coding, but doubt that that would
> be important for the use discussed in this thread).
>
> --
> Gregory (Greg) L. Snow Ph.D.
> Statistical Data Center
> Intermountain Healthcare
> greg.s...@imail.org
> 801.408.8111
>
>
> > -----Original Message-----
> > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-
> > project.org] On Behalf Of Faiz Rasool
> > Sent: Saturday, May 22, 2010 2:39 AM
> > To: R-help@r-project.org
> > Subject: Re: [R] Getting sink to work with "message" on R 2.11.0 - what
> > didI miss?
> >
> > Thank you to all of those who are trying to help me.
> >
> > I am using Windows XP, and using a screen reader called JAWS. When I
> > type
> > something at the console, I hear once what I have typed, and then the
> > focus
> > is on the next line. Then if I press the up arrow key I get to hear the
> > function I just typed, not its output. For example if I type mean(x)
> > and
> > then I press enter I will hear "[5]" if it is the mean of x. Then I
> > will
> > hear ">". Now if I want to find out what was the mean of x by pressing
> > the
> > up arrow key, I will only hear mean(x) and I will not hear [5]. My
> > screen
> > reader does provide options to use different cursors to read command
> > lines.
> > but if I have typed median(x) sd(x) var(x) length(x) after typing
> > mean(x),
> > it takes a long time before I can move my cursor to the location where
> > I can
> > hear the mean of x. If the results of the commands can be diverted to
> > MS
> > Word it becomes comparatively easy for me to quickly move forward and
> > backward in the document. Following suggestion of Gregory Snow, I will
> > look
> > at emacs. I could not find the txtStart function and TeachingDemos
> > package
> > after typing TxtStart() and library(TeachingDemos) I am unable to
> > decide how
> > to use the code provided by David Winsemius. Should I just copy that to
> > console and it will start to divert the output to a txt or a .doc file?
> >
> > Thank you once again to all of those who have participated in this
> > thread.
> > Faiz.
> >
> >  ----- Original Message -----
> > From: "David Winsemius" <dwinsem...@comcast.net>
> > To: "Greg Snow" <greg.s...@imail.org>
> > Cc: <r-help@r-project.org>
> > Sent: Saturday, May 22, 2010 2:46 AM
> > Subject: Re: [R] Getting sink to work with "message" on R 2.11.0 - what
> > didI
> > miss?
> >
> >
> > >
> > > On May 21, 2010, at 5:34 PM, Greg Snow wrote:
> > >
> > >> Look at txtStart and friends in the TeachingDemos package as an
> > >> alternative to sink that includes commands as well as output.
> > >
> > > Know the quality of Greg Snows work it will probably be better than
> > mine,
> > > but perhaps:
> > >
> > > > capfn <- function(inp) {
> > > +          instring <- deparse(substitute(inp))
> > > +          capture.output(instring, inp, file="all.Rout") }
> > > > capfn(1+3)
> > >
> > > The file looks like this:
> > >
> > > [1] "1 + 3"
> > > [1] 4
> > >>
> > >> --
> > >> Gregory (Greg) L. Snow Ph.D.
> > >> Statistical Data Center
> > >> Intermountain Healthcare
> > >> greg.s...@imail.org
> > >> 801.408.8111
> > >>
> > >>
> > >>> -----Original Message-----
> > >>> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-
> > >>> project.org] On Behalf Of Tal Galili
> > >>> Sent: Friday, May 21, 2010 3:21 PM
> > >>> To: David Winsemius
> > >>> Cc: r-help@r-project.org
> > >>> Subject: Re: [R] Getting sink to work with "message" on R 2.11.0 -
> > what
> > >>> did I miss?
> > >>>
> > >>> Hi David,
> > >>>
> > >>> I want to get both the 4 and the "1+3" that created it.
> > >>>
> > >>> I am trying to help someone else on the mailing list that is
> > looking
> > >>> for a
> > >>> way to "sink" the console into word, so he could have word read it
> > to
> > >>> him
> > >>> (he is blind).
> > >>> I know how to do the second part, but the first part (using sink
> > with
> > >>> the
> > >>> commands, and not just the output), I am somehow missing...
> > >>>
> > >>> Best,
> > >>> Tal
> > >>>
> > >>>
> > >>>
> > >>> ----------------Contact
> > >>> Details:-------------------------------------------------------
> > >>> Contact me: tal.gal...@gmail.com |  972-52-7275845
> > >>> Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il
> > (Hebrew)
> > >>> |
> > >>> www.r-statistics.com (English)
> > >>> -------------------------------------------------------------------
> > ----
> > >>> -----------------------
> > >>>
> > >>>
> > >>>
> > >>>
> > >>> On Sat, May 22, 2010 at 12:17 AM, David Winsemius
> > >>> <dwinsem...@comcast.net>wrote:
> > >>>
> > >>>>
> > >>>> On May 21, 2010, at 5:02 PM, Tal Galili wrote:
> > >>>>
> > >>>> Hi all,
> > >>>>>
> > >>>>> I am trying to use type message with sink, like this:
> > >>>>>
> > >>>>> sink("all.Rout", type="message")
> > >>>>> 1+3
> > >>>>>
> > >>>>> sink()
> > >>>>>
> > >>>>> readLines(con = "all.Rout")
> > >>>>>
> > >>>>> So to get the following output:
> > >>>>>
> > >>>>> 1+3
> > >>>>>>
> > >>>>> [1] 4
> > >>>>>
> > >>>>> Obviously this doesn't work.
> > >>>>>
> > >>>>>
> > >>>> What are you trying to do? The sink help page has two rather dire
> > >>> warnings
> > >>>> about not using type="message",  and using type="output would give
> > >>> you what
> > >>>> you ask:
> > >>>>
> > >>>>> sink("all.Rout", type="output")
> > >>>>
> > >>>>> 1+3
> > >>>>>
> > >>>>> sink()
> > >>>>>
> > >>>>> readLines(con = "all.Rout")
> > >>>> [1] "[1] 4"
> > >>>>
> > >>>> The extra "[1]" and quotes are from the readLines function, not
> > from
> > >>>> all.Rout.
> > >>>>
> > >>>>
> > >>>> I tried some variations (based on the explanations in the help)
> > but
> > >>> am
> > >>>>> missing something on how to make it work.
> > >>>>>
> > >>>>> Any suggestions?
> > >>>>>
> > >>>>> (p.s: I need this so to help Faiz Rasool in his latest post)
> > >>>>>
> > >>>>> Thanks,
> > >>>>>
> > >>>>> Tal
> > >>>>>
> > >>>> --
> > >>>> David Winsemius, MD
> > >>>> West Hartford, CT
> > >>>>
> > >>>>
> > >>>
> > >>> [[alternative HTML version deleted]]
> > >>>
> > >>> ______________________________________________
> > >>> 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.
> > >
> > > David Winsemius, MD
> > > West Hartford, CT
> > >
> > > ______________________________________________
> > > 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.
> >
> > ----- Original Message -----
> > From: "David Winsemius" <dwinsem...@comcast.net>
> > To: "Greg Snow" <greg.s...@imail.org>
> > Cc: <r-help@r-project.org>
> > Sent: Saturday, May 22, 2010 2:46 AM
> > Subject: Re: [R] Getting sink to work with "message" on R 2.11.0 - what
> > didI
> > miss?
> >
> >
> > >
> > > On May 21, 2010, at 5:34 PM, Greg Snow wrote:
> > >
> > >> Look at txtStart and friends in the TeachingDemos package as an
> > >> alternative to sink that includes commands as well as output.
> > >
> > > Know the quality of Greg Snows work it will probably be better than
> > mine,
> > > but perhaps:
> > >
> > > > capfn <- function(inp) {
> > > +          instring <- deparse(substitute(inp))
> > > +          capture.output(instring, inp, file="all.Rout") }
> > > > capfn(1+3)
> > >
> > > The file looks like this:
> > >
> > > [1] "1 + 3"
> > > [1] 4
> > >>
> > >> --
> > >> Gregory (Greg) L. Snow Ph.D.
> > >> Statistical Data Center
> > >> Intermountain Healthcare
> > >> greg.s...@imail.org
> > >> 801.408.8111
> > >>
> > >>
> > >>> -----Original Message-----
> > >>> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-
> > >>> project.org] On Behalf Of Tal Galili
> > >>> Sent: Friday, May 21, 2010 3:21 PM
> > >>> To: David Winsemius
> > >>> Cc: r-help@r-project.org
> > >>> Subject: Re: [R] Getting sink to work with "message" on R 2.11.0 -
> > what
> > >>> did I miss?
> > >>>
> > >>> Hi David,
> > >>>
> > >>> I want to get both the 4 and the "1+3" that created it.
> > >>>
> > >>> I am trying to help someone else on the mailing list that is
> > looking
> > >>> for a
> > >>> way to "sink" the console into word, so he could have word read it
> > to
> > >>> him
> > >>> (he is blind).
> > >>> I know how to do the second part, but the first part (using sink
> > with
> > >>> the
> > >>> commands, and not just the output), I am somehow missing...
> > >>>
> > >>> Best,
> > >>> Tal
> > >>>
> > >>>
> > >>>
> > >>> ----------------Contact
> > >>> Details:-------------------------------------------------------
> > >>> Contact me: tal.gal...@gmail.com |  972-52-7275845
> > >>> Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il
> > (Hebrew)
> > >>> |
> > >>> www.r-statistics.com (English)
> > >>> -------------------------------------------------------------------
> > ----
> > >>> -----------------------
> > >>>
> > >>>
> > >>>
> > >>>
> > >>> On Sat, May 22, 2010 at 12:17 AM, David Winsemius
> > >>> <dwinsem...@comcast.net>wrote:
> > >>>
> > >>>>
> > >>>> On May 21, 2010, at 5:02 PM, Tal Galili wrote:
> > >>>>
> > >>>> Hi all,
> > >>>>>
> > >>>>> I am trying to use type message with sink, like this:
> > >>>>>
> > >>>>> sink("all.Rout", type="message")
> > >>>>> 1+3
> > >>>>>
> > >>>>> sink()
> > >>>>>
> > >>>>> readLines(con = "all.Rout")
> > >>>>>
> > >>>>> So to get the following output:
> > >>>>>
> > >>>>> 1+3
> > >>>>>>
> > >>>>> [1] 4
> > >>>>>
> > >>>>> Obviously this doesn't work.
> > >>>>>
> > >>>>>
> > >>>> What are you trying to do? The sink help page has two rather dire
> > >>> warnings
> > >>>> about not using type="message",  and using type="output would give
> > >>> you what
> > >>>> you ask:
> > >>>>
> > >>>>> sink("all.Rout", type="output")
> > >>>>
> > >>>>> 1+3
> > >>>>>
> > >>>>> sink()
> > >>>>>
> > >>>>> readLines(con = "all.Rout")
> > >>>> [1] "[1] 4"
> > >>>>
> > >>>> The extra "[1]" and quotes are from the readLines function, not
> > from
> > >>>> all.Rout.
> > >>>>
> > >>>>
> > >>>> I tried some variations (based on the explanations in the help)
> > but
> > >>> am
> > >>>>> missing something on how to make it work.
> > >>>>>
> > >>>>> Any suggestions?
> > >>>>>
> > >>>>> (p.s: I need this so to help Faiz Rasool in his latest post)
> > >>>>>
> > >>>>> Thanks,
> > >>>>>
> > >>>>> Tal
> > >>>>>
> > >>>> --
> > >>>> David Winsemius, MD
> > >>>> West Hartford, CT
> > >>>>
> > >>>>
> > >>>
> > >>> [[alternative HTML version deleted]]
> > >>>
> > >>> ______________________________________________
> > >>> 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.
> > >
> > > David Winsemius, MD
> > > West Hartford, CT
> > >
> > > ______________________________________________
> > > 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.
>
> ______________________________________________
> 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.
>

        [[alternative HTML version deleted]]

______________________________________________
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