[R] R2HTML output shows NULL
Joshua Wiley
jwiley.psych at gmail.com
Sat Apr 28 00:07:11 CEST 2012
On Fri, Apr 27, 2012 at 2:52 PM, Greg Snow <538280 at gmail.com> wrote:
> Jeff, there are also many times that people are told not to post HTML,
> so this case would be a bit of a Catch 22. Also some of us (well me
> at least, I expect others have as well) have experienced this already
> and fully understand what is being discussed without needing an
> example (and for this case I don't know that those who don't already
> understand what she is saying would benefit much from the example
> without the output).
>
> Erin,
>
> I have seen the same thing (as well as all the output from the hist
> function being printed and other things that are usually invisible)
> and have not found a way to suppress/hide the usually invisible
> output.
I have struggled with this for some time. (embarrassingly, I
filed/assigned myself a bug report over 6 months ago) you can track
the status here:
https://r-forge.r-project.org/tracker/index.php?func=detail&aid=1628&group_id=405&atid=1643
It seems like there should be two solutions: A) somehow never grab
output that was meant to be invisible B) grab but then parse out such
output. It is not too difficult to alter the internals of R2HTML to
not print NULLs, but at least the easy way is global. I.e., any code
output that is only NULL is simply dropped, even though sometimes
there are legitimate cases. This is essentially the latter approach
where there are the NULLs but clever printing avoids printing them. I
have not had enough time to fully grasp the underlying workings of how
output is redirected and stored. If anyone has suggestions, I would
be happy to hear them. If anyone knows of nice guides/suggested
reading about how Sweave or the like work in R, I would also be
interested. Everytime I have gone straight to the source code, I lose
sight of the forest for the trees =\
I have not forgotten or stopped working on it, but I was not the
original package author so I have a lot to learn about how it works
and I am swamped with classes and research presently so progress is
slow.
Josh
>
> An alternative is the txtStart and friends functions in the
> TeachingDemos package (which were inspired by, but not as fancy as,
> the R2HTML package). Like R2HTML those functions will copy your
> session to a file (currently plain text, enhanced text (can be post
> processed with the enscript program to provide color and embedded
> graphics), or MS Word documents (via the R2wd package), .rtf files
> (via the rtf package) are planned). These functions by default do not
> include output that is returned invisibly.
>
> On Fri, Apr 27, 2012 at 2:06 PM, Jeff Newmiller
> <jdnewmil at dcn.davis.ca.us> wrote:
>> Haven't you been asked to provide an example of code that illustrates your problem often enough by now to anticipate the request in your first post?
>> ---------------------------------------------------------------------------
>> Jeff Newmiller The ..... ..... Go Live...
>> DCN:<jdnewmil at dcn.davis.ca.us> Basics: ##.#. ##.#. Live Go...
>> Live: OO#.. Dead: OO#.. Playing
>> Research Engineer (Solar/Batteries O.O#. #.O#. with
>> /Software/Embedded Controllers) .OO#. .OO#. rocks...1k
>> ---------------------------------------------------------------------------
>> Sent from my phone. Please excuse my brevity.
>>
>> Erin Hodgess <erinm.hodgess at gmail.com> wrote:
>>
>>>Hello R People:
>>>
>>>I am using the R2HTML program for the first time (actually yesterday),
>>>and I have a question, please:
>>>
>>>I am getting NULL in the webpage in several places, presumably where
>>>NULL would appear on the screen.
>>>
>>>How would I go about fixing that, please?
>>>
>>>Thanks,
>>>Erin
>>>
>>>
>>>--
>>>Erin Hodgess
>>>Associate Professor
>>>Department of Computer and Mathematical Sciences
>>>University of Houston - Downtown
>>>mailto: erinm.hodgess at gmail.com
>>>
>>>______________________________________________
>>>R-help at 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 at 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.
>
>
>
> --
> Gregory (Greg) L. Snow Ph.D.
> 538280 at gmail.com
>
> ______________________________________________
> R-help at 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.
--
Joshua Wiley
Ph.D. Student, Health Psychology
Programmer Analyst II, Statistical Consulting Group
University of California, Los Angeles
https://joshuawiley.com/
More information about the R-help
mailing list