The new RStudio notebook allows inline tables but this requires that the function returns knitr::asis_output instead of using the viewer. Unfortunately it currently ignores interactive use of knit_print and it doesn't have any obvious ways for detecting when running within a notebook.