0

我正在使用 R-Markdown 和 Tufte 模板编写报告。我在报告中嵌入了闪亮的应用程序。

到目前为止,我尝试在块选项中使用“fig.width=”和“width=”无济于事,然后
按照 B. Davis 的建议在右括号之前尝试了“, options = list(height = 600)”更改嵌入在 r markdown HTML 中的闪亮应用程序的尺寸也没有变化。


hist_dist <- read.csv("hist_dist2.csv", check.names = FALSE)

inputPanel(

selectInput("dist", label = "Choose an ecosystem to explore historical disturbance regimes:", choices = hist_dist$`Ecosystem`, selected = "Northern Hardwoods Forest" ,  width = '70%')
)

renderPlotly({
        ggplot(filter(hist_dist, Ecosystem == input$dist), aes(x=Disturbance, y=Acres)) +
            geom_bar(stat="identity", fill = "darkslategrey") +
            coord_flip() +
            theme(legend.position='none') +
            expand_limits(y=c(0, 60)) +
            theme_bw() + 
            theme(panel.background = element_rect(colour = "grey", fill=NA, size=1), 
            text = element_text(family = "serif", size = 14), 
            panel.grid.major = element_blank(),
            panel.grid.minor = element_blank(), 
            axis.line = element_line(colour = "black")
)

}


)
'''


I am able to change the width if I use other templates (non-Tufte), and are able to control the size of figures, just not Shiny apps.
4

1 回答 1

0
于 2019-06-13T05:45:00.553 回答