Adding jpg files to a report view

Study Forum (Inactive)
Adding jpg files to a report view wonjong.moon  2008-03-02 15:23
Status: Closed
 
I am working on R report view, because I need to add jpg pictures into the formatted report (see attached file; Amplification.tif).
My plan was using rimage and plot to generate a pdf file (see labkeyl_pdf.pdf).

I could not insert a jpg file into the pdf file yet, since I could not install 'rimage' package.
for example;

library(rimage)
datalogo<-read.jpeg("/usr/local/labkey/datasets/morogoro_rna/bioan.jpg")
plot.imagematrix(datalogo)

Is there better way to do this with Labkey ?

Thanks.
 
 
marki responded:  2008-03-02 16:30
Not sure if this is what you want, but you can insert arbitrary HTML into your R view. This HTML can contain an <img> tag that will show your image.

To include HTML in your R view you do something like this:

        txt <- paste("<img src='/MyStudy/bioan.jpg'>")
        capture.output(txt, file="${htmlout:output}")
 
Of course you'll need a path to the correct http-accessible file in there. If there are lots of files you might want to use the file content module ( https://www.labkey.org/Wiki/home/Documentation/page.view?name=fileContent ) to serve files from your server.