Thanks everyone for your help,

To summarize a resolution to my issue, it turns out that an image can be
include in a documentation file via html by putting an image file in the
inst/doc directory, for example inst/doc/myPic.png, and then pointing to it
in the man/myHelpPage.Rd file, for example as follows:

\if{html}{
\out{<img src="../doc/myPic.png" alt="image ../doc/myPic.png should be
here"/>}
}\ifelse{latex}{}{}

Note, this doesn¹t mean that R¹s help browser will view those images inside
the properly generated html help files.
Also, note that without the \out{} part, the text of the <img .../>  line
would show up instead of the html commands.
 
I have some concerns incase anyone on the list is interested. If it¹s a
large picture this process nearly crashes my machine when trying to access
the file via help‹and I¹m sure there must be some bug in that. I should note
that the picture won¹t actually display within R¹s help console (at least on
my machine--I¹m on a mac with a binary version of R). To see that the html
files are created properly, I have to copy a link to the help file and then
point an actual browser such as firefox to the help file to see the page
with the image. I¹m not sure how R is running httpd or how that interacts
with help. I¹m not even sure about the basics of help. Is there a way to
configure R to use an actual web browser by default instead of it¹s slow one
that doesn¹t show images? It would also be nice if there were an address bar
on R¹s help browser. I mean, until I put a link to my help file inside
another help file, there was no way for me to even get it¹s address to copy
and paste into firefox. It would also be nice if it didn¹t almost crash and
let me more easily get the link, but ideally it would be best not to have a
semi-functional help browser. Furthermore, this brings up the point that I
can¹t find the files I¹m browsing with the link. In this case, I get a link
such as: 
http://127.0.0.1:23269/library/MyPackage/html/MyPackage.html
But I can¹t find the MyPackage.html file anywhere on my computer. It¹s there
in the web browser, but seems to be only in existence via R¹s httpd without
actually existing on my file system.
Is it there and I can¹t find it or is it encoded in R somehow? If it is
there, where would it be? If I close R, I no longer have access to the page
that R¹s httpd is serving. It seems to me that it¹s being created every time
I use help‹and I think that is extremely inefficient. I think firefox can
handle file-type urls, so I if there is a way to get R to both generate
these files and use firefox to browse them for help, I would very much like
to know more about it. It would be much faster and useful than the status
quo on my machine if this file were generated once at installation and
remained as a file--and and using help simply pointed a web-browser to the
file.
Anyway, I suppose this is a tangent. The main point is that there is a way
to provide help documentation with images‹but even though it tries to view
them correctly via help‹R¹s help browser displays broken images so I have
the awkward need to copy and paste links into other web browsers.

Regarding some feedback I¹ve gotten about some user¹s interests in help
formatted as text, I think there are two things in this process that keep a
text help user on track: (1) the conditional html part and (2) even if using
a textual html browser, <img ... alt=²alternate text²/> take care of
displaying images as text. I think though that the other way around, the
users who require images in their help files are having less functionality
via help in R. At least in this case, the best I could do was get R to
generate the proper help pages in html, but R¹s default html help browser
(at least on my machine) doesn¹t display the images (although they are there
and can be displayed by the same link in firefox).
Sometimes it¹s true what they say about a picture being worth a thousand
words‹I think in general this is true for complex things that need computer
power to deal with, so I hope R can eventually support images in help files
due to the usefulness of doing so in some cases.

Thanks again,

Sean

        [[alternative HTML version deleted]]

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Reply via email to