Sean Robert McGuffee
2011-May-11 19:08 UTC
[Rd] How to document man/*.Rd pages with images?
Hi, I?m trying to figure out how to put images into my package?s help documentation. I?ve gotten to the point where I can put the images in the /inst/doc/ directory. I have also gotten to the point where I have package checks without any warnings. I couldn?t find the terms ?picture,? ?image,? or ?graphic? in a text search within the Writing R Extensions: 2 Writing R documentation files <http://cran.r-project.org/doc/manuals/R-exts.html#Writing-R-documentation-f iles> I tried a couple of LaTeX guesses, but they lead to the following errors on check: Warning: /LAB/SRM/PROGS/R_PACKAGES/Ralign/man/Ralign139.Rd:3: unexpected UNKNOWN '\usepackage' Warning: /LAB/SRM/PROGS/R_PACKAGES/Ralign/man/Ralign139.Rd:36: unknown macro '\includegraphics' What is the right way to do this? Thanks, Sean
On Wed, May 11, 2011 at 12:08 PM, Sean Robert McGuffee <sean.mcguffee at gmail.com> wrote:> Hi, > I?m trying to figure out how to put images into my package?s help > documentation. I?ve gotten to the point where I can put the images in the > /inst/doc/ directory. I have also gotten to the point where I have package > checks without any warnings. I couldn?t find the terms ?picture,? ?image,? > or ?graphic? in a text search within the Writing R Extensions: 2 Writing R > documentation files > <http://cran.r-project.org/doc/manuals/R-exts.html#Writing-R-documentation-f > iles> > I tried a couple of LaTeX guesses, but they lead to the following errors on > check: > Warning: /LAB/SRM/PROGS/R_PACKAGES/Ralign/man/Ralign139.Rd:3: unexpected > UNKNOWN '\usepackage' > Warning: /LAB/SRM/PROGS/R_PACKAGES/Ralign/man/Ralign139.Rd:36: unknown macro > '\includegraphics' > What is the right way to do this? > Thanks, > Sean >Given a graphics file called foo.png, you can include it in a vignette as follows: \includegraphics[width=0.5\textwidth]{foo} http://amath.colorado.edu/documentation/LaTeX/reference/figures.html Dan> > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel >
Sean Robert McGuffee
2011-May-11 19:42 UTC
[Rd] How to document man/*.Rd pages with images?
On 5/11/11 3:13 PM, "Dan Tenenbaum" <dtenenba@fhcrc.org> wrote:> On Wed, May 11, 2011 at 12:08 PM, Sean Robert McGuffee > <sean.mcguffee@gmail.com> wrote: >> Hi, >> I¹m trying to figure out how to put images into my package¹s help >> documentation. I¹ve gotten to the point where I can put the images in the >> /inst/doc/ directory. I have also gotten to the point where I have package >> checks without any warnings. I couldn¹t find the terms ³picture,² ³image,² >> or ³graphic² in a text search within the Writing R Extensions: 2 Writing R >> documentation files >> <http://cran.r-project.org/doc/manuals/R-exts.html#Writing-R-documentation-f >> iles> >> I tried a couple of LaTeX guesses, but they lead to the following errors on >> check: >> Warning: /LAB/SRM/PROGS/R_PACKAGES/Ralign/man/Ralign139.Rd:3: unexpected >> UNKNOWN ''\usepackage'' >> Warning: /LAB/SRM/PROGS/R_PACKAGES/Ralign/man/Ralign139.Rd:36: unknown macro >> ''\includegraphics'' >> What is the right way to do this? >> Thanks, >> Sean >> > > Given a graphics file called foo.png, you can include it in a vignette > as follows: > \includegraphics[width=0.5\textwidth]{foo}I''ve tried adding this in a man/*.Rd file, but I get the following warning: Warning: /LAB/SRM/PROGS/R_PACKAGES/Ralign/man/Ralign139.Rd:16: unknown macro ''\includegraphics'' In particular, I put \includegraphics{../doc/Sean.jpg} inside a \details{} section. It seems that the term "vignette" may somehow be different than the man/*.Rd files. As is somewhat typical of the R documentation, there is a whole section on 1.4 Writing package vignettes without a definition of "vignette" as far as I can tell. I want to clarify that I''m trying to put the images in a file that will come up when I type ??myPackageName or library(myPackageName);help(myPackageName). I''m not sure if that''s the same as a vignette or not, but either way, that command isn¹t working inside the file I want to put the images in. Right now the help command brings up my man/*.Rd files, which seem to be in LaTeX with the exception of not handling much of what is written about LaTeX formats from Google searches. First of all, are vignettes the same or different than the man/*.Rd files? Secondly, is it possible to show an images inside the man/*.Rd files? I think I started using man/*.Rd files because they were part of what a package skeleton started me with. I literally have everything I need working in man/*.Rd files except image references. Do I have to learn about vignettes now after all that work to get the man/*.Rd files going? I¹m so confused. It seems like there should be something like the \link{} command that simply shows an image inside the man/*.Rd files.> http://amath.colorado.edu/documentation/LaTeX/reference/figures.html > Dan > > >> >> ______________________________________________ >> R-devel@r-project.org mailing list >> https://stat.ethz.ch/mailman/listinfo/r-devel >>[[alternative HTML version deleted]]
> I?m trying to figure out how to put images into my package?s help > documentation. I?ve gotten to the point where I can put the images in the > /inst/doc/ directory. I have also gotten to the point where I have package > checks without any warnings. I couldn?t find the terms ?picture,? ?image,? > or ?graphic? in a text search within the Writing R Extensions: 2 Writing R > documentation filesI think you're asking the wrong question. You should be asking: "Can I include images in help files?". As far as I know, the answer is no. You might be able to do it for specific output formats. See http://cran.r-project.org/doc/manuals/R-exts.html#Conditional-text Hadley -- Assistant Professor / Dobelman Family Junior Chair Department of Statistics / Rice University http://had.co.nz/
I thought the usual logic was that you might put graphs and images into a vignette, and you might refer to the vignette in an Rd help file, but you would not put the graphs into the help because ? access to the page cannot assume that you actual have a graphics device. Of course, examples in the Rd file can generate the graphs. Paul> -----Original Message----- > From: r-devel-bounces at r-project.org [mailto:r-devel-bounces at r- > project.org] On Behalf Of Sean Robert McGuffee > Sent: May 11, 2011 3:08 PM > To: r-devel at r-project.org > Subject: [Rd] How to document man/*.Rd pages with images? > > Hi, > I?m trying to figure out how to put images into my package?s help > documentation. I?ve gotten to the point where I can put the images in > the > /inst/doc/ directory. I have also gotten to the point where I have > package > checks without any warnings. I couldn?t find the terms ?picture,? > ?image,? > or ?graphic? in a text search within the Writing R Extensions: 2 > Writing R > documentation files > <http://cran.r-project.org/doc/manuals/R-exts.html#Writing-R- > documentation-f > iles> > I tried a couple of LaTeX guesses, but they lead to the following > errors on > check: > Warning: /LAB/SRM/PROGS/R_PACKAGES/Ralign/man/Ralign139.Rd:3: > unexpected > UNKNOWN '\usepackage' > Warning: /LAB/SRM/PROGS/R_PACKAGES/Ralign/man/Ralign139.Rd:36: unknown > macro > '\includegraphics' > What is the right way to do this? > Thanks, > Sean > > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel=================================================================================== La version fran?aise suit le texte anglais. ------------------------------------------------------------------------------------ This email may contain privileged and/or confidential in...{{dropped:26}}
Seemingly Similar Threads
- Build a package - check error
- Rcmd check problem
- Clustering with R - efficient processing of large sparse data sets (text data)
- FW: [Rcpp-devel] Question on 5.6 Interfacing C++ code
- sshd (openssh 3.7.1p1) dies during login on Solaris 8 system with SRM installed