[英]Splitting Rstudio's Viewer pane: possible?
I was wondering if there might be a way to split Rstudio's Viewer pane (like par(mfrow = 2:1)
for the Plot pane ) so that I could display 2 flextable
objects?我想知道是否有办法拆分 Rstudio 的查看器窗格(如Plot 窗格的
par(mfrow = 2:1)
),以便我可以显示 2 个flextable
对象?
library('flextable')
dat1 <- data.frame(Approaches = c("Y", "Y", "N"), Meets = c("N", "Y", "N"), row.names = c("Read", "Math", "Sci."))
dat2 <- data.frame(Read = "Y", Math = "N")
flextable(dat1) # Display this
flextable(dat2) # and Display this
That's possible with htmltools
package:这可以通过
htmltools
包实现:
library(htmltools)
library(flextable)
dat1 <- data.frame(Approaches = c("Y", "Y", "N"), Meets = c("N", "Y", "N"), row.names = c("Read", "Math", "Sci."))
dat2 <- data.frame(Read = "Y", Math = "N")
browsable(tagList(
htmltools_value(flextable(dat1)), # Display this
tags$hr(),
htmltools_value(flextable(dat2)) # and Display
))
This is a basic example, you can get much more complex layout with css and htmltools.这是一个基本示例,您可以使用 css 和 htmltools 获得更复杂的布局。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.