(sometimes it's a good idea to RTFM (talking to my self as well, cf my comment to OP)
reactivePlot(func, width = "auto", height = "auto", ...)
width The width of the rendered plot, in pixels; or ’auto’ to use the offsetWidth of
the HTML element that is bound to this plot. You can also pass in a function
that returns the width in pixels or ’auto’; in the body of the function you may
reference reactive values and functions.
*height* The height of the rendered plot, in pixels; or ’auto’ to use the offsetHeight
of the HTML element that is bound to this plot. You can also pass in a function
that returns the width in pixels or ’auto’; in the body of the function you may
reference reactive values and functions.
... Arguments to be passed through to png. These can be used to set the width,
height, background color, etc.
however, so far I couldn't manage to make to work (with height="15in"
)...
Error in switch(units, `in` = res, cm = res/2.54, mm = res/25.4, px = 1) * :
non-numeric argument to binary operator
EDIT: it's now working, height
has to be numeric, with optional units="px"
and res
certainly something to convert units
to pixels.
EDIT 2: and don't forget to update Shiny [to the last version], it fixes some bugs I faced.
EDIT 3: here is an example where the height is dynamically changed:
getVarHeight <- function() {
return(getNumberOfPlots() * 400)
}
output$out <- reactivePlot(doPlots, height=getVarHeight)
You can relate the snippet to this screenshot, where getNumberOfPlots
returns the number of graph to plot.
EDIT 4: if you want to display several images, you should change the height
in 'ui.R' as well: this value is directly transmitted to CSS, and the default value is 400px
. So if your images are bigger, they will overlap and only the to 400px will be visible ...
plotOutput(outputId = "plot_rain", height="100%"))