R shiny で出力される図のサイズを入力パラメータでうまくしたい

R shiny で図を出力するのだが、図の大きさをinputで入力したとき、renderPlotの引数(widthheight)にそれぞれ持たせようとすると、エラーになる。
状況としてはこんな感じである。

library(shiny)
server <- function(input, output, session) {
  height <- as.numeric(input$imageHeight)
  width  <- as.numeric(input$imageWidth)
  output$myplot <- renderPlot({
    plot(iris)
  }, height=height, width=width)
}

ui <- fluidPage(
  numericInput("imageWidth", "図の幅", 480, min = 1, max = 2000),
  numericInput("imageHeight", "図の幅", 560, min = 1, max = 2000),
  mainPanel(
    plotOutput(outputId="myplot", height="auto")
  )
)
shinyApp(ui, server)
 警告:  Error in : Can't access reactive value 'imageHeight' outside of reactive consumer.
ℹ Do you need to wrap inside reactive() or observe()?
  55: <Anonymous>
Error : Can't access reactive value 'imageHeight' outside of reactive consumer.
ℹ Do you need to wrap inside reactive() or observe()?

outputrenderPlotのオブジェクトを代入しようとしているが、renderPlot自体にはそれより先に作成されているはずのオブジェクト(height)はうまくなんやかんや出来ないらしい。
reactiveobserveを使え、と言われている。
というわけで探したらあった。
Problem getting height of renderPlot to be reactive to number of questions plotted - #6 by WillP - shiny - RStudio Community

library(shiny)
server <- function(input, output, session) {
  height <- reactive(input$imageHeight)   # reactive
  width  <- reactive(input$imageWidth)
  observe({                                     # observe
    output$myplot <- renderPlot({ 
      plot(iris)
    }, height=height(), width=width())    # () と関数化されている
  })
}

ui <- fluidPage(
  numericInput("imageWidth", "図の幅", 480, min = 1, max = 2000),
  numericInput("imageHeight", "図の幅", 560, min = 1, max = 2000),
  mainPanel(
    plotOutput(outputId="myplot", height="auto")
  )
)
shinyApp(ui, server)

出力されるhtml環境に合わせて図を拡大縮小しようとも思ったが、ブラウザのサイズ(というか図のサイズ)を定量的に保存しておきたいときに、ドラッグでブラウザのサイズを変えるのはよろしくないので採用できなかった。
Shiny でプロットの高さをブラウザ画面のサイズに合わせて変更する | Atusy's blog

そもそも図を描出するときに、Rだとdev.new(width=7, height=7)でプロットのためのキャンバスが登場するが、これをドラッグして拡大縮小したあとで、定量的にサイズ指定する方法がわからない。
拡大縮小したあとは、par()$dinでキャンバスの大きさを取得はできるが、par()$dinは読み取り専用で、任意の値の指定が出来ないので困っている。
https://www.rstudio.com/wp-content/uploads/2016/10/how-big-is-your-graph.pdf